From owner-freebsd-questions@freebsd.org Mon Nov 20 17:18:45 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45880DF142A for ; Mon, 20 Nov 2017 17:18:45 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay118.isp.belgacom.be (mailrelay118.isp.belgacom.be [195.238.20.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B92EB65549 for ; Mon, 20 Nov 2017 17:18:44 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AC+TypBac21YNljZAY28Inx3/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZoMSzbnLW6fgltlLVR4KTs6sC0LuG9fi4EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRp?= =?us-ascii?q?OOv1BpTSj8Oq3Oyu5pHfeQtFiT6+bL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+?= =?us-ascii?q?RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPC?= =?us-ascii?q?TQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjm58axlVAHnhz?= =?us-ascii?q?sGNz4h8WHYlMpwjL5AoBm8oxBz2pPYbJ2JOPZ7eK7WYNEUSndbXstJWSJPAp2y?= =?us-ascii?q?YZYMAeUDM+ZXoJXyqkALrReiGQWhHv/jxiNKi3LwwKY00/4hEQbD3AE4AdwOsX?= =?us-ascii?q?bUrNHoP6oMVuC1y7LIwivGb/xM3zf985XDfxc9ofGNX7JwddHcx0k1FwzbkFqd?= =?us-ascii?q?tJHrMT2P2uQKqWib4PNtWOSygGAkswF8ujuiyto2hoXXiY8YykrI+Th7zYsxP9?= =?us-ascii?q?G1SUx2bNi5G5VKrS6aLZF5QsY6TmFtvyY116MJtIagfCgP1JQn3xnfa+Gbc4SQ?= =?us-ascii?q?4hLsSuKRITBgiXJmYr2/gxey8U2+xe3mUcm4ykpKritHktnIrHwCyxvT6s+cSv?= =?us-ascii?q?Rj+0euwzCP1xvJ5uFDO0A0mrLXK58nwrEuipoeqUfOEjLslEnog6Kbdl8o9vWq?= =?us-ascii?q?5unjeLnrp52RO5dxig7kM6QunsK/Af4/MggLR2Wb5eW81L/n/UDiTrVKlOM5nb?= =?us-ascii?q?fCv5DBOMsXvKm5AxVa0oo78RawEy+m0MgEnXkANF9FewyIj47vO17QPPD4Dfe/?= =?us-ascii?q?jE6wkDd32f/GOqfuApPQIXXYn7fheKxy609YyAYp0d9f4JdUWfk9J6fQV0n3uc?= =?us-ascii?q?DYRj8wLxC5x+/hBJ0p1Y4YX2+TAq+QLL/ftVaO6sogJuCNYMkevzOreNY/4Pu7?= =?us-ascii?q?sX47nRc2eq6y0J4ebmvwSuhnIUGxT2Dhj/06PSENpAVoH7+is0GLTTMGPyX6ZK?= =?us-ascii?q?k7/DxuTdv+VYo=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2A4BwBhDRNa/0Oz9VFbGwEBAQEDAQEBC?= =?us-ascii?q?QEBAYM8VhBuJ4N/ixOOMwEBgXw0AYgnjgaCESmBYoM6AoR+QRcBAQEBAQEBAQE?= =?us-ascii?q?BaiiCOCQBgkIBBSMzIxALGAkhAgIPEhgeBhOKDQMZqFmCJ4czDYM1AQEBAQEBB?= =?us-ascii?q?AEBAQEBFA+DNIVFgyuCa4VFgmMFiiqHSpANPYRJgymIIYRsgQCBI4oShySNLIp?= =?us-ascii?q?AIAE3gXRVMgiDLQmCUAMcgWhANotMAQEB?= X-IPAS-Result: =?us-ascii?q?A2A4BwBhDRNa/0Oz9VFbGwEBAQEDAQEBCQEBAYM8VhBuJ4N?= =?us-ascii?q?/ixOOMwEBgXw0AYgnjgaCESmBYoM6AoR+QRcBAQEBAQEBAQEBaiiCOCQBgkIBB?= =?us-ascii?q?SMzIxALGAkhAgIPEhgeBhOKDQMZqFmCJ4czDYM1AQEBAQEBBAEBAQEBFA+DNIV?= =?us-ascii?q?FgyuCa4VFgmMFiiqHSpANPYRJgymIIYRsgQCBI4oShySNLIpAIAE3gXRVMgiDL?= =?us-ascii?q?QmCUAMcgWhANotMAQEB?= Received: from 67.179-245-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.245.179.67]) by relay.skynet.be with ESMTP; 20 Nov 2017 18:17:29 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id vAKHHSeR011920; Mon, 20 Nov 2017 18:17:28 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Mon, 20 Nov 2017 18:17:27 +0100 From: Tijl Coosemans To: Kenneth Hatteland Cc: freebsd-questions@freebsd.org Subject: Re: FreeBSD 11.1 SSD low browser performance Message-ID: <20171120181727.7881bfd0@kalimero.tijl.coosemans.org> In-Reply-To: <34c0a9bc-26f1-2203-eb9e-fc9ea00484de@gmail.com> References: <34c0a9bc-26f1-2203-eb9e-fc9ea00484de@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/.qy4G/biVXZ3Cn_fEk4794O" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 17:18:45 -0000 --MP_/.qy4G/biVXZ3Cn_fEk4794O Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Mon, 20 Nov 2017 16:22:26 +0100 Kenneth Hatteland wrote: > I have a problem that annoys me and makes my desktop use painful. I have= =20 > put a rather cheap Kingdian SSD into my box after my HDD seemed slow,=20 > but it did not enhance performance that much. It is when I use internet=20 > browsers the problem occurs. The browser works slow, freeze very often=20 > and video is choppy. It is from time to time impossible to switch=20 > between tabs, and graphics load painfully slow. When these things occur,= =20 > the hard drive light blinks madly. >=20 > When I use the machine with other software it is snappy and responsive.=20 > Music is flawless etc. So onlly when=C2=A0 I use firefox, Chromium or Iri= dium. >=20 > I have been thinking perhaps something about TRIM should be set up ? Or=20 > does anyone have other clues what I can do/check ? If you have enough memory try mounting tmpfs on /tmp. If not, try the attached patch for firefox. Just drop it in /usr/ports/www/firefox/files and rebuild firefox. --MP_/.qy4G/biVXZ3Cn_fEk4794O Content-Type: text/x-patch Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename=patch-shmem --- ipc/chromium/src/base/shared_memory.h.orig 2017-06-15 20:51:57 UTC +++ ipc/chromium/src/base/shared_memory.h @@ -114,7 +114,6 @@ class SharedMemory { // are technically only unique to a single filesystem. However, we always // allocate shared memory backing files from the same directory, so will end // up on the same filesystem. - SharedMemoryId id() const { return inode_; } #endif // Closes the open shared memory segment. @@ -174,7 +173,6 @@ class SharedMemory { HANDLE mapped_file_; #elif defined(OS_POSIX) int mapped_file_; - ino_t inode_; #endif void* memory_; bool read_only_; --- ipc/chromium/src/base/shared_memory_posix.cc.orig 2017-06-15 20:51:57 UTC +++ ipc/chromium/src/base/shared_memory_posix.cc @@ -22,7 +22,6 @@ namespace base { SharedMemory::SharedMemory() : mapped_file_(-1), - inode_(0), memory_(NULL), read_only_(false), max_size_(0) { @@ -41,7 +40,6 @@ bool SharedMemory::SetHandle(SharedMemoryHandle handle } mapped_file_ = handle.fd; - inode_ = st.st_ino; read_only_ = read_only; return true; } @@ -155,13 +153,8 @@ bool SharedMemory::CreateOrOpen(const std::wstring &na // It doesn't make sense to have a read-only private piece of shmem DCHECK(posix_flags & (O_RDWR | O_WRONLY)); - FilePath path; - fp = file_util::CreateAndOpenTemporaryShmemFile(&path); - - // Deleting the file prevents anyone else from mapping it in - // (making it private), and prevents the need for cleanup (once - // the last fd is closed, it is truly freed). - file_util::Delete(path); + int fd = shm_open(SHM_ANON, posix_flags, 0600); + fp = fdopen(fd, "a+"); } else { std::wstring mem_filename; if (FilenameForMemoryName(name, &mem_filename) == false) @@ -214,7 +207,6 @@ bool SharedMemory::CreateOrOpen(const std::wstring &na struct stat st; if (fstat(mapped_file_, &st)) NOTREACHED(); - inode_ = st.st_ino; return true; } @@ -224,7 +216,7 @@ bool SharedMemory::Map(size_t bytes) { return false; memory_ = mmap(NULL, bytes, PROT_READ | (read_only_ ? 0 : PROT_WRITE), - MAP_SHARED, mapped_file_, 0); + MAP_SHARED | MAP_NOSYNC, mapped_file_, 0); if (memory_) max_size_ = bytes; --MP_/.qy4G/biVXZ3Cn_fEk4794O--