From patchwork Mon Oct 26 07:41:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 11855841 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6011139F for ; Mon, 26 Oct 2020 07:41:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5E9AE223AC for ; Mon, 26 Oct 2020 07:41:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="M6t8PNi6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E9AE223AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2B29C6B005D; Mon, 26 Oct 2020 03:41:42 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 23AAE6B0062; Mon, 26 Oct 2020 03:41:42 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DACA6B0068; Mon, 26 Oct 2020 03:41:42 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id CE1166B005D for ; Mon, 26 Oct 2020 03:41:41 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 41618180AD817 for ; Mon, 26 Oct 2020 07:41:41 +0000 (UTC) X-FDA: 77413282002.11.badge59_5a048bc27271 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 18AEC180F8B81 for ; Mon, 26 Oct 2020 07:41:41 +0000 (UTC) X-Spam-Summary: 10,1,0,8d3b459a23645fd1,d41d8cd98f00b204,jhubbard@nvidia.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1437:1513:1515:1516:1518:1521:1535:1544:1605:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2901:3138:3139:3140:3141:3142:3740:3865:3867:3868:3870:3874:4117:4184:4250:4321:4362:4418:4605:5007:6119:6120:6261:6653:7901:7903:10004:11026:11232:11473:11658:11914:12043:12266:12296:12297:12438:12521:12555:12895:12986:14096:14097:14180:14181:14394:14721:21060:21080:21365:21450:21451:21611:21627:21889:21990:30003:30054:30055:30064,0,RBL:216.228.121.143:@nvidia.com:.lbl8.mailshell.net-64.201.201.201 62.22.0.100;04y8rk8xibgxixqsfkq7x1hqfyghuopbaq8rjfpub3hdgp4cjojtw6egeh61qp3.op5z7zseo8cg7nb6mk5urcmfx3mky3hw3tpf1c3s7r5bisfphd46hfk7qm5d4xa.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: badge59_5a048bc27271 X-Filterd-Recvd-Size: 6466 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Mon, 26 Oct 2020 07:41:40 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 26 Oct 2020 00:41:46 -0700 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 26 Oct 2020 07:41:38 +0000 Received: from sandstorm.nvidia.com (172.20.13.39) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Mon, 26 Oct 2020 07:41:38 +0000 From: John Hubbard To: Andrew Morton CC: LKML , , John Hubbard , Oleg Nesterov Subject: [PATCH] mm: cleanup: remove unused tsk arg from __access_remote_vm Date: Mon, 26 Oct 2020 00:41:37 -0700 Message-ID: <20201026074137.4147787-1-jhubbard@nvidia.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 X-NVConfidentiality: public DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1603698106; bh=kNTURRfltlV2Fvs3TVU4HcRoa3nFHuc50Qm9MLel+Uc=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:MIME-Version: X-NVConfidentiality:Content-Transfer-Encoding:Content-Type; b=M6t8PNi6Td0RPzt/a/iTp1Ajz3t2xn6O4iYzGL4Bolo0OHN4f95P8cfjWk0Ef6a1l ZzeH3Cns5AEhaofS4tuJ/81LvDvjRPy/9YvVMVMWXuwE7+aerIiO/mZGwNA4xzgGjr jE2HQ+sOm5A1DGgue7p/UqmZ1J7fvbvJoCRQSIc50t62O86Mo2OpueqWGueHBWMTAY 75o7644HuTXHaXJEWfBDhbFk5BK/Hdkb2cJdHvdDDFDQfq/UOZw7kdXl0BfZQaJsxg /2MWYjn5oWUXHxiE4nn6gEt/RJoT+q4MOfp+YWyzow8KlDMNcOF/L5qJvz2mx7RFYg B+XElhpPMtoFA== 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: 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. Signed-off-by: John Hubbard Cc: Oleg Nesterov 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(-) base-commit: 3650b228f83adda7e5ee532e2b90429c03f7b9ec 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;