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.2.00.1006010813440.3637@i5.linux-foundation.org>
Date:	Tue, 1 Jun 2010 08:22:25 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Jens Axboe <axboe@...nel.dk>
cc:	mtk.manpages@...il.com,
	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Miklos Szeredi <miklos@...redi.hu>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [patch] pipe: add support for shrinking and growing pipes



On Tue, 1 Jun 2010, Jens Axboe wrote:
> 
> > Also, the minuimum size of the buffer is 2 pages. Why is it not 1?
> > (Notwithstanding Linus's assertion, a buffer size of 1 page did give
> > us POSIX compliance in kernels before 2.6.10.)
> 
> I'll defer to Linus on that, I remember some emails on that part from
> way back when. As far as I can tell, POSIX wants atomic writes of "less
> than a page size", which would make more sense as "of a page size and
> less". And since it should not be a page size from either side on a
> uni-directional pipe, then 1 page seems enough for that guarantee at
> least.

Hmm. You guys may well be right that a single slot is sufficient. It still 
gives us PIPE_BUF worth of data for writing atomically. I had this memory 
that we needed two because of the merging logic (we have that special case 
for re-using the previous page, so that we don't use waste of memory for 
lots of small writes), but looking at the code there is no reason at all 
for me to hav thought so.

So I don't know why I thought we needed the extra slot, and a single slot 
(if anybody really wants slow writes) looks to be fine.

		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