All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <christian.brauner@ubuntu.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Mike Christie <michael.christie@oracle.com>,
	stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com,
	sgarzare@redhat.com, virtualization@lists.linux-foundation.org,
	axboe@kernel.dk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/8] fork: add helper to clone a process
Date: Fri, 17 Sep 2021 09:44:40 +0200	[thread overview]
Message-ID: <20210917074440.qwo6anrtxa7lj657@wittgenstein> (raw)
In-Reply-To: <YUQvAy8HDh5oYyqn@infradead.org>

On Fri, Sep 17, 2021 at 07:00:35AM +0100, Christoph Hellwig wrote:
> On Thu, Sep 16, 2021 at 04:20:44PM -0500, Mike Christie wrote:
> > The vhost layer has similar requirements as io_uring where its worker
> > threads need to access the userspace thread's memory, want to inherit the
> > parents's cgroups and namespaces, and be checked against the parent's
> > RLIMITs. Right now, the vhost layer uses the kthread API which has
> > kthread_use_mm for mem access, and those threads can use
> > cgroup_attach_task_all for v1 cgroups, but there are no helpers for the
> > other items.
> > 
> > This adds a helper to clone a process so we can inherit everything we
> > want in one call. It's a more generic version of create_io_thread which
> > will be used by the vhost layer and io_uring in later patches in this set.
> > 
> > This patch also exports __set_task_comm and wake_up_new_task which is
> > needed by modules to use the new helper. io_uring calls these functions
> > already but its always built into the kernel so was not needed before.
> 
> Can you build proper APIs please?  e.g. the set_task_comm users
> generally want a printf-like varargs caling conventions.  I'd also
> much prefer to hide as much as possible in the actual helper.  That is
> build a helper that gets the name, a flag to ignore the singals etc
> instead of exporting all these random low-level helpers.

Yes, I think that's really what we want here.

  reply	other threads:[~2021-09-17  7:44 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 21:20 [PATCH 0/8] Use copy_process/create_io_thread in vhost layer Mike Christie
2021-09-16 21:20 ` Mike Christie
2021-09-16 21:20 ` [PATCH 1/8] fork: add helper to clone a process Mike Christie
2021-09-16 21:20   ` Mike Christie
2021-09-17  6:00   ` Christoph Hellwig
2021-09-17  6:00     ` Christoph Hellwig
2021-09-17  7:44     ` Christian Brauner [this message]
2021-09-17  8:01       ` Christoph Hellwig
2021-09-17  8:01         ` Christoph Hellwig
2021-09-17  8:43         ` Christian Brauner
2021-09-17  8:48   ` Christian Brauner
2021-09-16 21:20 ` [PATCH 2/8] signal: Export ignore_signals Mike Christie
2021-09-16 21:20   ` Mike Christie
2021-09-16 21:20 ` [PATCH 3/8] fork: add option to not clone or dup files Mike Christie
2021-09-16 21:20   ` Mike Christie
2021-09-17  8:54   ` Christian Brauner
2021-09-16 21:20 ` [PATCH 4/8] fork: move PF_IO_WORKER's kernel frame setup to new flag Mike Christie
2021-09-16 21:20   ` Mike Christie
2021-09-16 21:20 ` [PATCH 5/8] io_uring: switch to kernel_copy_process Mike Christie
2021-09-16 21:20   ` Mike Christie
2021-09-16 21:20 ` [PATCH 6/8] vhost: move worker thread fields to new struct Mike Christie
2021-09-16 21:20   ` Mike Christie
2021-09-16 21:20 ` [PATCH 7/8] vhost: use kernel_copy_process to check RLIMITs and inherit cgroups Mike Christie
2021-09-16 21:20   ` Mike Christie
2021-09-19  8:24   ` Hillf Danton
2021-09-20 20:47   ` kernel test robot
2021-09-20 20:47     ` kernel test robot
2021-09-20 20:47     ` kernel test robot
2021-09-16 21:20 ` [PATCH 8/8] vhost: remove cgroup code Mike Christie
2021-09-16 21:20   ` Mike Christie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210917074440.qwo6anrtxa7lj657@wittgenstein \
    --to=christian.brauner@ubuntu.com \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.christie@oracle.com \
    --cc=mst@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.