[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87v7sm44l7.fsf@prevas.dk>
Date: Thu, 06 Mar 2025 15:27:16 +0100
From: Rasmus Villemoes <ravi@...vas.dk>
To: Oleg Nesterov <oleg@...hat.com>
Cc: K Prateek Nayak <kprateek.nayak@....com>, Linus Torvalds
<torvalds@...ux-foundation.org>, Miklos Szeredi <miklos@...redi.hu>,
Alexander Viro <viro@...iv.linux.org.uk>, Christian Brauner
<brauner@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>, Hugh
Dickins <hughd@...gle.com>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, Jan Kara
<jack@...e.cz>, "Matthew Wilcox (Oracle)" <willy@...radead.org>, Mateusz
Guzik <mjguzik@...il.com>, "Gautham R. Shenoy" <gautham.shenoy@....com>,
Neeraj.Upadhyay@....com, Ananth.narayan@....com, Swapnil Sapkal
<swapnil.sapkal@....com>
Subject: Re: [RFC PATCH 3/3] treewide: pipe: Convert all references to
pipe->{head,tail,max_usage,ring_size} to unsigned short
On Thu, Mar 06 2025, Oleg Nesterov <oleg@...hat.com> wrote:
> On 03/06, K Prateek Nayak wrote:
>>
>> @@ -272,9 +272,9 @@ pipe_read(struct kiocb *iocb, struct iov_iter *to)
>> */
>> for (;;) {
>> /* Read ->head with a barrier vs post_one_notification() */
>> - unsigned int head = smp_load_acquire(&pipe->head);
>> - unsigned int tail = pipe->tail;
>> - unsigned int mask = pipe->ring_size - 1;
>> + unsigned short head = smp_load_acquire(&pipe->head);
>> + unsigned short tail = pipe->tail;
>> + unsigned short mask = pipe->ring_size - 1;
>
> I dunno... but if we do this, perhaps we should
> s/unsigned int/pipe_index_t instead?
>
> At least this would be more grep friendly.
Agreed. Also, while using u16 on all arches may be good for now to make
sure everything is updated, it may also be that it ends up causing
suboptimal code gen for 64 bit architectures, so even if we do change
pipe_index_t now, perhaps we'd want to change it back to "half a ulong"
at some point in the future.
Rasmus
Powered by blists - more mailing lists