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: <alpine.LFD.0.98.0706020836360.23741@woody.linux-foundation.org>
Date:	Sat, 2 Jun 2007 08:40:04 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Jens Axboe <jens.axboe@...cle.com>
cc:	"H. Peter Anvin" <hpa@...or.com>,
	Eric Dumazet <dada1@...mosbay.com>,
	linux-kernel@...r.kernel.org, cotte@...ibm.com, hugh@...itas.com,
	neilb@...e.de, zanussi@...ibm.com, hch@...radead.org
Subject: Re: [PATCH] sendfile removal



On Sat, 2 Jun 2007, Jens Axboe wrote:
>
> splice() WILL return EAGAIN, but in that case it should have triggered
> the read-ahead and thus started some IO.

That's not enough.

If the IO has already been started, splice needs to wait.

> For the from-file case, see __generic_file_splice_read(). splice does:
> 
>        if (!PageUptodate(page)) {
>                /*
>                 * If in nonblock mode then dont block on
>                 * waiting
>                 * for an in-flight io page
>                 */
>                if (flags & SPLICE_F_NONBLOCK) {
>                        if (TestSetPageLocked(page))
>                                break;
>                } else
>                        lock_page(page);

Yeah, that's just wrong.

Your suggested:

>       if ((flags & SPLICE_F_NONBLOCK) && spd.nr_pages) {
>               if (TestSetPageLocked(page))
>                       break;
>       } else
>               lock_page(page);
> 
> should do that - always block for the first page and potentially return
> a partial results for the remaining pages that read-ahead kicked into
> gear.

would work, but I suspect that for a server, returning EAGAIN once is 
actually the best option - if it has a select() loop, and something else 
is running, the "return EAGAIN once" actually makes tons of sense (it 
would basically boil down to the kernel effectively saying "ok, try 
anything else you might have pending in your queues first, if you get back 
to me, I'll block then").

		Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ