Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 May 2015 21:38:52 +0300
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        alc@FreeBSD.org, arch@FreeBSD.org
Subject:   Re: more strict KPI for vm_pager_get_pages()
Message-ID:  <20150504183852.GK34544@glebius.int.ru>
In-Reply-To: <20150504095116.GF2390@kib.kiev.ua>
References:  <20150430142408.GS546@nginx.com> <20150504082426.GC2390@kib.kiev.ua> <20150504091137.GH34544@glebius.int.ru> <20150504095116.GF2390@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150504183852.GK34544>