[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200508183653.GB125527@google.com>
Date: Fri, 8 May 2020 11:36:53 -0700
From: Minchan Kim <minchan@...nel.org>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>, linux-api@...r.kernel.org,
oleksandr@...hat.com, Suren Baghdasaryan <surenb@...gle.com>,
Tim Murray <timmurray@...gle.com>,
Daniel Colascione <dancol@...gle.com>,
Sandeep Patil <sspatil@...gle.com>,
Sonny Rao <sonnyrao@...gle.com>,
Brian Geffon <bgeffon@...gle.com>,
Michal Hocko <mhocko@...e.com>,
Johannes Weiner <hannes@...xchg.org>,
Shakeel Butt <shakeelb@...gle.com>,
John Dias <joaodias@...gle.com>,
Joel Fernandes <joel@...lfernandes.org>,
Jann Horn <jannh@...gle.com>,
alexander.h.duyck@...ux.intel.com, sj38.park@...il.com,
Christian Brauner <christian@...uner.io>,
Kirill Tkhai <ktkhai@...tuozzo.com>
Subject: Re: [PATCH v7 5/7] mm: support both pid and pidfd for process_madvise
On Tue, Mar 10, 2020 at 05:42:51PM -0700, Minchan Kim wrote:
> On Fri, Mar 06, 2020 at 12:14:19PM +0100, Vlastimil Babka wrote:
> > On 3/2/20 8:36 PM, Minchan Kim wrote:
> > > There is a demand[1] to support pid as well pidfd for process_madvise
> > > to reduce unnecessary syscall to get pidfd if the user has control of
> > > the target process(ie, they could guarantee the process is not gone
> > > or pid is not reused).
> > >
> > > This patch aims for supporting both options like waitid(2). So, the
> > > syscall is currently,
> > >
> > > int process_madvise(int which, pid_t pid, void *addr,
> > > size_t length, int advise, unsigned long flag);
> >
> > This is again halfway between kernel and userspace description, so if we stick
> > to userspace then it's:
> >
> > int process_madvise(idtype_t idtype, id_t id, void *addr,
> > size_t length, int advice, unsigned long flags);
>
> Yub.
>
Hi Andrew,
Per Vlastimil's request, I changed "which and advise" with "idtype and
advice" in function prototype of description.
Could you replace the part in the description? Code is never changed.
Thanks.
>From f11cfd023746ae67b89f2d84d960706ba6c5c911 Mon Sep 17 00:00:00 2001
From: Minchan Kim <minchan@...nel.org>
Date: Wed, 6 May 2020 13:54:40 +0000
Subject: [PATCH] mm/madvise: support both pid and pidfd for process_madvise
There is a demand[1] to support pid as well pidfd for process_madvise to
reduce unnecessary syscall to get pidfd if the user has control of the
target process(ie, they could guarantee the process is not gone or pid is
not reused).
This patch aims for supporting both options like waitid(2). So, the
syscall is currently,
int process_madvise(idtype_t idtype, id_t id, void *addr,
size_t length, int advice, unsigned long flags);
@which is actually idtype_t for userspace libray and currently, it
supports P_PID and P_PIDFD.
[1] https://lore.kernel.org/linux-mm/9d849087-3359-c4ab-fbec-859e8186c509@virtuozzo.com/
Link: http://lkml.kernel.org/r/20200302193630.68771-6-minchan@kernel.org
Signed-off-by: Minchan Kim <minchan@...nel.org>
Suggested-by: Kirill Tkhai <ktkhai@...tuozzo.com>
Reviewed-by: Suren Baghdasaryan <surenb@...gle.com>
Reviewed-by: Vlastimil Babka <vbabka@...e.cz>
Cc: Christian Brauner <christian@...uner.io>
Cc: Alexander Duyck <alexander.h.duyck@...ux.intel.com>
Cc: Brian Geffon <bgeffon@...gle.com>
Cc: Daniel Colascione <dancol@...gle.com>
Cc: Jann Horn <jannh@...gle.com>
Cc: Jens Axboe <axboe@...nel.dk>
Cc: Joel Fernandes <joel@...lfernandes.org>
Cc: Johannes Weiner <hannes@...xchg.org>
Cc: John Dias <joaodias@...gle.com>
Cc: Michal Hocko <mhocko@...e.com>
Cc: Oleksandr Natalenko <oleksandr@...hat.com>
Cc: Sandeep Patil <sspatil@...gle.com>
Cc: SeongJae Park <sj38.park@...il.com>
Cc: SeongJae Park <sjpark@...zon.de>
Cc: Shakeel Butt <shakeelb@...gle.com>
Cc: Sonny Rao <sonnyrao@...gle.com>
Cc: Tim Murray <timmurray@...gle.com>
Cc: <linux-man@...r.kernel.org>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Powered by blists - more mailing lists