From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10152C4363A for ; Mon, 26 Oct 2020 09:57:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7B2C62223C for ; Mon, 26 Oct 2020 09:57:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="jsdvoezV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B2C62223C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8C3246B005D; Mon, 26 Oct 2020 05:57:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 873E86B0062; Mon, 26 Oct 2020 05:57:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73D526B0068; Mon, 26 Oct 2020 05:57:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id 43ACE6B005D for ; Mon, 26 Oct 2020 05:57:55 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id CF855840F for ; Mon, 26 Oct 2020 09:57:54 +0000 (UTC) X-FDA: 77413625268.14.crate14_061398727272 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id AF2A518229818 for ; Mon, 26 Oct 2020 09:57:54 +0000 (UTC) X-HE-Tag: crate14_061398727272 X-Filterd-Recvd-Size: 6428 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Mon, 26 Oct 2020 09:57:54 +0000 (UTC) Received: from kernel.org (unknown [87.70.96.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0C9D822202; Mon, 26 Oct 2020 09:57:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603706273; bh=wtdKbIZ2qTydFUtmnkADSICjasq+Dj2neVT/nOLvOb4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jsdvoezVXrGHZKVZ+w54EEmVFcXiA9XurYdgbiz+v6Gsg8kZb8M8QESWk5luEoUZa rN5ZnhuyqRdn4qNSyx8BQwcWx6UaR0iV3czPt7Ib3rlB8dT6IaoxcPU/EtnW7mQIP3 1kBPGNI+uH8gWF10JJXwEptRrVmzY9/AFXleI764= Date: Mon, 26 Oct 2020 11:57:45 +0200 From: Mike Rapoport To: John Hubbard Cc: Andrew Morton , LKML , linux-mm@kvack.org, Oleg Nesterov Subject: Re: [PATCH] mm: cleanup: remove unused tsk arg from __access_remote_vm Message-ID: <20201026095745.GE1154158@kernel.org> References: <20201026074137.4147787-1-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026074137.4147787-1-jhubbard@nvidia.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Oct 26, 2020 at 12:41:37AM -0700, John Hubbard wrote: > Despite a comment that said that page fault accounting would be charged > to whatever task_struct* was passed into __access_remote_vm(), the tsk > argument was actually unused. > > Delete both the comment, and the argument. I'd also mention that making page fault accounting actually use this task struct is quite a project, so there is no point to keep tsk argument. > Signed-off-by: John Hubbard > Cc: Oleg Nesterov FWIW: Reviewed-by: Mike Rapoport > --- > > Hi, > > Just something that caught my eye when I was reviewing a semi-related > patchset. > > thanks, > John Hubbard > NVIDIA > > include/linux/mm.h | 4 ++-- > kernel/ptrace.c | 2 +- > mm/memory.c | 11 +++++------ > mm/nommu.c | 8 ++++---- > 4 files changed, 12 insertions(+), 13 deletions(-) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index ef360fe70aaf..b3b85a5c5937 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -1716,8 +1716,8 @@ extern int access_process_vm(struct task_struct *tsk, unsigned long addr, > void *buf, int len, unsigned int gup_flags); > extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, > void *buf, int len, unsigned int gup_flags); > -extern int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, > - unsigned long addr, void *buf, int len, unsigned int gup_flags); > +extern int __access_remote_vm(struct mm_struct *mm, unsigned long addr, > + void *buf, int len, unsigned int gup_flags); > > long get_user_pages_remote(struct mm_struct *mm, > unsigned long start, unsigned long nr_pages, > diff --git a/kernel/ptrace.c b/kernel/ptrace.c > index 43d6179508d6..fbbe32443b18 100644 > --- a/kernel/ptrace.c > +++ b/kernel/ptrace.c > @@ -57,7 +57,7 @@ int ptrace_access_vm(struct task_struct *tsk, unsigned long addr, > return 0; > } > > - ret = __access_remote_vm(tsk, mm, addr, buf, len, gup_flags); > + ret = __access_remote_vm(mm, addr, buf, len, gup_flags); > mmput(mm); > > return ret; > diff --git a/mm/memory.c b/mm/memory.c > index c48f8df6e502..25b28bc251d5 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -4874,11 +4874,10 @@ EXPORT_SYMBOL_GPL(generic_access_phys); > #endif > > /* > - * Access another process' address space as given in mm. If non-NULL, use the > - * given task for page fault accounting. > + * Access another process' address space as given in mm. > */ > -int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, > - unsigned long addr, void *buf, int len, unsigned int gup_flags) > +int __access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, > + int len, unsigned int gup_flags) > { > struct vm_area_struct *vma; > void *old_buf = buf; > @@ -4955,7 +4954,7 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, > int access_remote_vm(struct mm_struct *mm, unsigned long addr, > void *buf, int len, unsigned int gup_flags) > { > - return __access_remote_vm(NULL, mm, addr, buf, len, gup_flags); > + return __access_remote_vm(mm, addr, buf, len, gup_flags); > } > > /* > @@ -4973,7 +4972,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, > if (!mm) > return 0; > > - ret = __access_remote_vm(tsk, mm, addr, buf, len, gup_flags); > + ret = __access_remote_vm(mm, addr, buf, len, gup_flags); > > mmput(mm); > > diff --git a/mm/nommu.c b/mm/nommu.c > index 0faf39b32cdb..870fea12823e 100644 > --- a/mm/nommu.c > +++ b/mm/nommu.c > @@ -1675,8 +1675,8 @@ void filemap_map_pages(struct vm_fault *vmf, > } > EXPORT_SYMBOL(filemap_map_pages); > > -int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, > - unsigned long addr, void *buf, int len, unsigned int gup_flags) > +int __access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, > + int len, unsigned int gup_flags) > { > struct vm_area_struct *vma; > int write = gup_flags & FOLL_WRITE; > @@ -1722,7 +1722,7 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, > int access_remote_vm(struct mm_struct *mm, unsigned long addr, > void *buf, int len, unsigned int gup_flags) > { > - return __access_remote_vm(NULL, mm, addr, buf, len, gup_flags); > + return __access_remote_vm(mm, addr, buf, len, gup_flags); > } > > /* > @@ -1741,7 +1741,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in > if (!mm) > return 0; > > - len = __access_remote_vm(tsk, mm, addr, buf, len, gup_flags); > + len = __access_remote_vm(mm, addr, buf, len, gup_flags); > > mmput(mm); > return len; > > base-commit: 3650b228f83adda7e5ee532e2b90429c03f7b9ec > -- > 2.29.0 > > -- Sincerely yours, Mike.