[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h6475w9q.fsf@prevas.dk>
Date: Wed, 05 Mar 2025 16:31:45 +0100
From: Rasmus Villemoes <ravi@...vas.dk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Oleg Nesterov <oleg@...hat.com>, 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, Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH] pipe_read: don't wake up the writer if the pipe is
still full
On Mon, Mar 03 2025, Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Mon, 3 Mar 2025 at 10:28, Oleg Nesterov <oleg@...hat.com> wrote:
>>
>> Stupid question... but do we really need to change the code which update
>> tail/head if we pack them into a single word?
>
> No. It's only the READ_ONCE() parts that need changing.
>
> See this suggested patch, which does something very similar to what
> you were thinking of.
>
> +/*
> + * We have to declare this outside 'struct pipe_inode_info',
> + * but then we can't use 'union pipe_index' for an anonymous
> + * union, so we end up having to duplicate this declaration
> + * below. Annoying.
> + */
> +union pipe_index {
> + unsigned long head_tail;
> + struct {
> + pipe_index_t head;
> + pipe_index_t tail;
> + };
> +};
> +
-fms-extensions ? Willy wanted to add that for use in mm/ some years ago
[*], and it has come up a few other times as well.
[*] https://lore.kernel.org/lkml/20180419152817.GD25406@bombadil.infradead.org/
Rasmus
Powered by blists - more mailing lists