From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Begunkov Subject: Re: [PATCH 5/6] kernel: better document the use_mm/unuse_mm API contract Date: Sat, 4 Apr 2020 16:07:31 +0300 Message-ID: <8c1e6600-bee3-d074-28e6-813a6dbf5fd0@gmail.com> References: <20200404094101.672954-1-hch@lst.de> <20200404094101.672954-6-hch@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20200404094101.672954-6-hch@lst.de> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Christoph Hellwig , Linus Torvalds , Andrew Morton Cc: Jens Axboe , Felipe Balbi , "Michael S. Tsirkin" , Jason Wang , intel-gvt-dev@lists.freedesktop.org, Felix Kuehling , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, Al Viro , linux-fsdevel@vger.kernel.org, Alex Deucher , intel-gfx@lists.freedesktop.org, io-uring@vger.kernel.org List-Id: virtualization@lists.linuxfoundation.org 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