[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250304221138.GG5756@redhat.com>
Date: Tue, 4 Mar 2025 23:11:39 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mateusz Guzik <mjguzik@...il.com>,
K Prateek Nayak <kprateek.nayak@....com>,
"Sapkal, Swapnil" <swapnil.sapkal@....com>,
Manfred Spraul <manfred@...orfullife.com>,
Christian Brauner <brauner@...nel.org>,
David Howells <dhowells@...hat.com>,
WangYuli <wangyuli@...ontech.com>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
"Shenoy, Gautham Ranjal" <gautham.shenoy@....com>,
Neeraj.Upadhyay@....com, Ananth.narayan@....com
Subject: Re: [PATCH] pipe_read: don't wake up the writer if the pipe is still
full
On 03/04, Linus Torvalds wrote:
>
> On Tue, 4 Mar 2025 at 02:55, Oleg Nesterov <oleg@...hat.com> wrote:
> >
> > > + * Really only alpha needs 32-bit fields, but
> > > + * might as well do it for 64-bit architectures
> > > + * since that's what we've historically done,
> > > + * and it makes 'head_tail' always be a simple
> > > + * 'unsigned long'.
> > > + */
> > > +#ifdef CONFIG_64BIT
> > > + typedef unsigned int pipe_index_t;
> > > +#else
> > > + typedef unsigned short pipe_index_t;
> > > +#endif
> >
> > I am just curious, why we can't use "unsigned short" unconditionally
> > and avoid #ifdef ?
> >
> > Is "unsigned int" more efficient on 64-bit?
>
> The main reason is that a "unsigned short" write on alpha isn't atomic
Yes, I have already realized this when I tried to actually read the
comment, see my next email in reply to myself.
But thanks for your detailed explanation!
Oleg.
Powered by blists - more mailing lists