On Mon, 13 Feb 2023 at 21:04, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > > On Sat, Feb 11, 2023 at 5:39 PM Ming Lei <ming.lei@xxxxxxxxxx> wrote: > > > > > > > > (a) what's the point of MAY_READ? A non-readable page sounds insane > > > and wrong. All sinks expect to be able to read. > > > > For example, it is one page which needs sink end to fill data, so > > we needn't to zero it in source end every time, just for avoiding > > leak kernel data if (unexpected)sink end simply tried to read from > > the spliced page instead of writing data to page. > > I still don't understand. > > A sink *reads* the data. It doesn't write the data. I think Ming is trying to generalize splice to allow flowing data in the opposite direction. So yes, sink would be writing to the buffer. And it MUST NOT be reading the data since the buffer may be uninitialized. The problem is how to tell the original source that the buffer is ready? PG_uptodate comes to mind, but pipe buffers allow partial pages to be passed around, and there's no mechanism to describe a partially uptodate buffer. Thanks, Miklos