From owner-freebsd-arch@FreeBSD.ORG Mon May 4 18:38:57 2015 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB1FAFE4; Mon, 4 May 2015 18:38:57 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 553C813A0; Mon, 4 May 2015 18:38:56 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t44IcqK1044291 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 4 May 2015 21:38:52 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t44Icq2u044290; Mon, 4 May 2015 21:38:52 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 4 May 2015 21:38:52 +0300 From: Gleb Smirnoff To: Konstantin Belousov Cc: alc@FreeBSD.org, arch@FreeBSD.org Subject: Re: more strict KPI for vm_pager_get_pages() Message-ID: <20150504183852.GK34544@glebius.int.ru> References: <20150430142408.GS546@nginx.com> <20150504082426.GC2390@kib.kiev.ua> <20150504091137.GH34544@glebius.int.ru> <20150504095116.GF2390@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150504095116.GF2390@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 18:38:57 -0000 On Mon, May 04, 2015 at 12:51:16PM +0300, Konstantin Belousov wrote: K> > On Mon, May 04, 2015 at 11:24:26AM +0300, Konstantin Belousov wrote: K> > K> Below is the summary of my part of the internal discussion about the changes. K> > K> > Quite short. Is it truncated? K> No. IMO, I pointed out the most important point about the patch. If K> other changes in the patch are unrelated, they must be extracted and K> discussed (and committed) separately. Due to the fundamental nature of K> the code being changed, the extra work to make it easier to bisect and K> detect regressions worth it. Of course, I'm not going to commit it as one. Some parts can be separated. K> > K> Traditionally, Unix allows the filesystems to perform the short reads. K> > K> Most fundamental change in the patch removes this freedom from the K> > K> filesystem implementation, and I think that only local filesystems could K> > K> be compliant with the proposed strictness. K> > K> K> > K> IMO, the response from vm_pager_haspages() is only advisory, since K> > K> filesystem might not control the external entities which are the source K> > K> of the required data. K> > K> > That's why remote filesystems use vop_stdbmap() (or similar), which K> > always return zeroes for "after" and "before" hints. K> K> Which precludes useful optimizations, at all, in the future. If in the future there appears a new consumer, who is fine with partial success, and if in the future there would appear a pager, that may fail to satisfy its own hints, then we will simply: 1) Relax assertions at the end of vm_pager_get_pages() and thus allow partial success. 2) Let the new consumer scan returned pages and check their 'valid' bits. 3) All current consumers, who prefer all or none result, would still look at the return value, as they do now. No change for them. So, I'd insist that patch doesn't preclude future optimizations. Instead, the current 'one page valid & busy, all pages unbusied' approach blocks different optimizations. The consumer usually has better idea on what to do with the pages. P.S. Meanwhile Peter pho@ reported 32 hour successful test run with the patch. -- Totus tuus, Glebius.