From owner-freebsd-bugs@freebsd.org Sun Dec 3 04:59:39 2017 Return-Path: Delivered-To: freebsd-bugs@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 C8071DEE77A for ; Sun, 3 Dec 2017 04:59:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B63D36B795 for ; Sun, 3 Dec 2017 04:59:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id vB34xdh2098490 for ; Sun, 3 Dec 2017 04:59:39 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 223831] [patch] swap_pager.c to release multiple swap blocks at a time Date: Sun, 03 Dec 2017 04:59:39 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.1-STABLE X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: ota@j.email.ne.jp X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Dec 2017 04:59:39 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223831 --- Comment #3 from ota@j.email.ne.jp --- (In reply to Konstantin Belousov from comment #2) Indeed, 1st patch chunk failed and I overlooked it. Also, I missed offset initialization. To answer your question, I started with 2 reasons. #1 - I started looking at optimizing page-in cases and process exit cases w= here they had released 1 block at a time although swp_pager_freeswapspace() takes npages to free. This was the 3rd one. #2 - swp_pager_force_pagein() comment says "it doesn't work" and I wondered why. The reason I found is we need to call vm_page_grab for the number of pages we want to page in. Summing up, after I figured vm_page part, the code started working okay and based on my observation of "top", multi-block page-in was considerably fast= er - reading 1 block 32 times compare to 32 blocks a time. It looksvm_object_t = is locked during swapoff operation (while paging-in), too. During research, I found swap_pager_getpages() calls swap_pager_haspage() anyway and swap_pager_haspage() checks how many continuous blocks are behin= d.=20 So, I started researching from swap_pager_haspage() side instead of swblk s= ide. I had few questions like when to lock and how and when to increment vm_object_pip. I posted here for some feed backs. While checking patch failure against HEAD, I realized swp_pager_force_pagei= n() in HEAD had a change for (m->valid =3D=3D VM_PAGE_BITS_ALL) case. This cha= nge cleared some of my questions. I will update my changes and post a new one = for 11-STABLE and HEAD. --=20 You are receiving this mail because: You are the assignee for the bug.=