lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <nycvar.YFH.7.76.1901311223270.3281@cbobk.fhfr.pm>
Date:   Thu, 31 Jan 2019 12:34:44 +0100 (CET)
From:   Jiri Kosina <jikos@...nel.org>
To:     Florian Weimer <fweimer@...hat.com>
cc:     Vlastimil Babka <vbabka@...e.cz>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-api@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>,
        Greg KH <gregkh@...uxfoundation.org>,
        Jann Horn <jannh@...gle.com>,
        Dominique Martinet <asmadeus@...ewreck.org>,
        Andy Lutomirski <luto@...capital.net>,
        Dave Chinner <david@...morbit.com>,
        Kevin Easton <kevin@...rana.org>,
        Matthew Wilcox <willy@...radead.org>,
        Cyril Hrubis <chrubis@...e.cz>, Tejun Heo <tj@...nel.org>,
        "Kirill A . Shutemov" <kirill@...temov.name>,
        Daniel Gruss <daniel@...ss.cc>
Subject: Re: [PATCH 2/3] mm/filemap: initiate readahead even if IOCB_NOWAIT
 is set for the I/O

On Thu, 31 Jan 2019, Florian Weimer wrote:

> >> I think this needs to use a different flag because the semantics are so
> >> much different.  If I understand this change correctly, previously,
> >> RWF_NOWAIT essentially avoided any I/O, and now it does not.
> >
> > It still avoid synchronous I/O, due to this code still being in place:
> >
> >                 if (!PageUptodate(page)) {
> >                         if (iocb->ki_flags & IOCB_NOWAIT) {
> >                                 put_page(page);
> >                                 goto would_block;
> >                         }
> >
> > but goes the would_block path only after initiating asynchronous 
> > readahead.
> 
> But it wouldn't schedule asynchronous readahead before?

It would, that's kind of the whole point.

> I'm worried that something, say PostgreSQL doing a sequential scan, 
> would implement a two-pass approach, first using RWF_NOWAIT to process 
> what's in the kernel page cache, and then read the rest without it.  If 
> RWF_NOWAIT is treated as a prefetch hint, there could be much more read 
> activity, and a lot of it would be pointless because the data might have 
> to be evicted before userspace can use it.

So are you aware of anything already existing, that'd implement this 
semantics? I've quickly grepped https://github.com/postgres/postgres for 
RWF_NOWAIT, and they don't seem to use it at all. RWF_NOWAIT is rather 
new.

The usecase I am aware of is to make sure that the thread doing 
io_submit() doesn't get blocked for too long, because it has other things 
to do quickly in order to avoid starving other sub-threads (and delegate 
the I/O submission to asynchronous context).

-- 
Jiri Kosina
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ