linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Christoph Hellwig <hch@lst.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Jens Axboe <axboe@kernel.dk>, Felipe Balbi <balbi@kernel.org>,
	amd-gfx@lists.freedesktop.org,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Felix Kuehling <Felix.Kuehling@amd.com>,
	linux-usb@vger.kernel.org, io-uring@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	intel-gfx@lists.freedesktop.org,
	Alex Deucher <alexander.deucher@amd.com>,
	intel-gvt-dev@lists.freedesktop.org,
	Jason Wang <jasowang@redhat.com>
Subject: Re: [Intel-gfx] [PATCH 5/6] kernel: better document the use_mm/unuse_mm API contract
Date: Sat, 4 Apr 2020 16:07:31 +0300	[thread overview]
Message-ID: <8c1e6600-bee3-d074-28e6-813a6dbf5fd0@gmail.com> (raw)
In-Reply-To: <20200404094101.672954-6-hch@lst.de>

On 04/04/2020 12:41, Christoph Hellwig wrote:
> Switch the function documentation to kerneldoc comments, and add
> WARN_ON_ONCE asserts that the calling thread is a kernel thread and
> does not have ->mm set (or has ->mm set in the case of unuse_mm).
> 
> Also give the functions a kthread_ prefix to better document the
> use case.
> 

io_uring and io-wq bits LGTM.

> --- a/include/linux/kthread.h
> +++ b/include/linux/kthread.h
...
> -/*
> - * unuse_mm
> - *	Reverses the effect of use_mm, i.e. releases the
> - *	specified mm context which was earlier taken on
> - *	by the calling kernel thread
> - *	(Note: this routine is intended to be called only
> - *	from a kernel thread context)
> +/**
> + * kthread_use_mm - reverse the effect of kthread_use_mm()

s/kthread_use_mm/kthread_unuse_mm/
for the first one

> + * @mm: address space to operate on
>   */
> -void unuse_mm(struct mm_struct *mm)
> +void kthread_unuse_mm(struct mm_struct *mm)
>  {

-- 
Pavel Begunkov


  reply	other threads:[~2020-04-04 13:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04  9:40 improve use_mm / unuse_mm Christoph Hellwig
2020-04-04  9:40 ` [PATCH 1/6] amdgpu: a NULL ->mm does not mean a thread is a kthread Christoph Hellwig
2020-04-06 16:07   ` Felix Kuehling
2020-04-04  9:40 ` [PATCH 2/6] i915/gvt/kvm: " Christoph Hellwig
2020-04-04 10:05   ` Sergei Shtylyov
2020-04-07  3:08   ` Yan Zhao
2020-04-13 13:27     ` Christoph Hellwig
2020-04-14  0:04       ` Yan Zhao
2020-04-14  7:00         ` Christoph Hellwig
2020-04-14  7:03           ` Yan Zhao
2020-04-04  9:40 ` [PATCH 3/6] i915/gvt: remove unused xen bits Christoph Hellwig
2020-04-08  1:44   ` Zhenyu Wang
2020-04-13 13:08     ` Christoph Hellwig
2020-04-14  3:04       ` Zhenyu Wang
2020-04-04  9:40 ` [PATCH 4/6] kernel: move use_mm/unuse_mm to kthread.c Christoph Hellwig
2020-04-06 16:09   ` Felix Kuehling
2020-04-04  9:41 ` [PATCH 5/6] kernel: better document the use_mm/unuse_mm API contract Christoph Hellwig
2020-04-04 13:07   ` Pavel Begunkov [this message]
2020-04-06 16:10   ` Felix Kuehling
2020-04-04  9:41 ` [PATCH 6/6] kernel: set USER_DS in kthread_use_mm Christoph Hellwig
2020-04-06 21:49   ` Michael S. Tsirkin

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=8c1e6600-bee3-d074-28e6-813a6dbf5fd0@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=axboe@kernel.dk \
    --cc=balbi@kernel.org \
    --cc=hch@lst.de \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=io-uring@vger.kernel.org \
    --cc=jasowang@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).