Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp119614pxx; Mon, 26 Oct 2020 04:58:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxplxmA9I99j+Dw9jW/x/9fjWB2n+hNyUUzszAwJek0i7Ro30uO5UFzijhekI3Lv9EKn2lN X-Received: by 2002:a05:6402:1ad9:: with SMTP id ba25mr15699948edb.120.1603713499265; Mon, 26 Oct 2020 04:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603713499; cv=none; d=google.com; s=arc-20160816; b=GotvHq6l/m6AUSWpTKI3HlhR6zFPTvukdRFJ28smJh497jCwa0GvRvpCH4OhAWBhOO 57BhV5NqRy2o257doTL/gno2/VfPi4DVcAuiWB8KNSUeEI6K0QJ1q8XtM5MSUceDLWfO 2B3LFIJT6G54IMMQrUny98YVWGIVXWbrfwt0harjRQ7ncKpSlXGp27qyljGfI8DD4cFc eUCgmgbEGxWHDycpYPSp2YXfT/Lj49KEFSxYUyLI4ZoUn4qZM1XTFDDAjfvCR/bzNUZn VlP5M1ytD4sUgpa8P6I53EeVX8yOQMGVhahkhSxLqNl6HC3Nnrdy0r8goTira88Tau6T a9hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ug4PQrqCd7QoHfPVn6nhzzMAEZHQI97sAqa7DuYDLic=; b=khM90Lf3ghZQcheLkC7VAMO2m/q0o4dzE/QEAzt4Z/1tu8cNOUbrXmC+NmB6QcVadl s0ygWQybYw8js8xLivBzckYx4tfL8DAOzmK3BSzqrczHL6wrg0hZJ66fJajAV5YEDM1h M+498rQnllamGusauTkp4+1X2Z92VDqdN3zhV5BYxqPLmMpNpZxANi+1Fo7Uj3hG0N+Z Lvoj8pPyK+XO28NjgaQTN67RtE56sX/TkxE6YMgvm5PBHRSrp59nZG2K5JA7JibF+Sro BLlNNyJS2nlNYVb7tick9Mn0kppnQvSmolFMlIblMeqeOyZuddqMkm8Kf5It5PA0jsxR I4Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jsdvoezV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si4550106edh.159.2020.10.26.04.57.56; Mon, 26 Oct 2020 04:58:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jsdvoezV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1768794AbgJZJ6m (ORCPT + 99 others); Mon, 26 Oct 2020 05:58:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:47824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1768801AbgJZJ5y (ORCPT ); Mon, 26 Oct 2020 05:57:54 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.