From patchwork Wed Apr 13 21:13:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex Xu (Hello71)" X-Patchwork-Id: 12812702 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E1E3C433FE for ; Wed, 13 Apr 2022 21:14:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E96D06B0072; Wed, 13 Apr 2022 17:14:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E460E6B0073; Wed, 13 Apr 2022 17:14:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D0DD86B0074; Wed, 13 Apr 2022 17:14:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id BAF456B0072 for ; Wed, 13 Apr 2022 17:14:03 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 7B77523B5 for ; Wed, 13 Apr 2022 21:14:03 +0000 (UTC) X-FDA: 79353108366.08.FCFDF37 Received: from sonic304-25.consmr.mail.gq1.yahoo.com (sonic304-25.consmr.mail.gq1.yahoo.com [98.137.68.206]) by imf17.hostedemail.com (Postfix) with ESMTP id DC3A940005 for ; Wed, 13 Apr 2022 21:14:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s2048; t=1649884441; bh=JwDJBXmIBMVPp6KpM4t53S/ZeOI8/fENK+mBdPsfoPc=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=dsXZeNMQBuc4UzrnH1JOlgaOX7BywTSzigWKB4vrBMULuoqjKXv347pehAKTdTOe7Ur3W4fdkioVWHa2bEqsVwb2KVE0ABo667arwr0Hjc2lVueWcGPcpJtan7EEr7kJArdJG9mp5kKi969nnHHTyaFSBuvx639fyeuqZAF9JWQySR40ubAMPWh9oqSrvbrN7QuNn7oMnGYKB5O09tlltviyogpIu4LwRIkAnlkSsMiSVnrN38kt2iIUDmWgnyUSosPUL2hWXAVOQLK+Nw5MdBbLLjAbfqA9evZjw3E0sBimUjC1iIrFK1eMfWPXpX4uPstcm5sdYGI3HdnLMmTmPQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1649884441; bh=4dosHHkJgUtb2ahd4zHwUbhBuCutVzbjsTnpQw47Kys=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=d2V8u0Blp7RPz1X3E9+ezknBPfn9aOKg4N6kqlWNN/WKWBOLXfrnkIuFkR+o33fMsR6C1fnGGIq1O5RI9MBw401lPY4Ibxi2Wxlk9WlNtIh+asm1gUKAHVufSEIWPLO5y51APr5OWUGkO7hZNPlgubtnLNM0lpR/slT7N/no4j+z/nwErTkDuWpqr6g5rtwurlj4ecI40Q9lYKz5ziaNQM6dPQEx7cYF3xy+lwkfTC0y6OdEA/TY5W4t0G52KqDEpw22/dKjQ8VyqvZ+yVDI22c0xCTTW4Dc9j7dzancD5F/IV/lrQn2Am6zbhy54ZF4wbdoCuWQ5i/K+dtWMW/D0g== X-YMail-OSG: WGuFyh0VM1lyiSCIHjzjPC9AZ37hN2NIFEyWrCvwYHCqWnj6Cl0D9GcF4k9btqK sfqSdx1DaydnqrHee6rBE.YyQ4A7uo4ZlZFbHnK.MZrFj6YC.eN_gjzKWpzHJ0je124zmIWNNAfD 91LL22FnEUqVerc3w2YOh_BmiAD6jUo.GDW.JsDVpVnCmBjdffW279K51Ljyykrw67rx5pWksCby Ms4Tol4lDW0b3WoNKcPWDD8KQScf5CJIwnEeDAbjR_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ahoo.com with HTTP; Wed, 13 Apr 2022 21:14:01 +0000 Received: by hermes--canary-production-ne1-855b9c5d98-txrl8 (VZM Hermes SMTP Server) with ESMTPA ID 574483ab8d8a5f0795b3659afa4a2172; Wed, 13 Apr 2022 21:13:59 +0000 (UTC) From: "Alex Xu (Hello71)" To: Andrew Morton Cc: Vlastimil Babka , Daniel Colascione , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alexey Dobriyan , linux-api@vger.kernel.org, "Alex Xu (Hello71)" Subject: [PATCH] mm/smaps_rollup: return empty file for kthreads instead of ESRCH Date: Wed, 13 Apr 2022 17:13:57 -0400 Message-Id: <20220413211357.26938-1-alex_y_xu@yahoo.ca> X-Mailer: git-send-email 2.35.2 MIME-Version: 1.0 References: <20220413211357.26938-1-alex_y_xu.ref@yahoo.ca> X-Stat-Signature: j7ykrepxpuxw1d59jxihfyhjebc9mfzu Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=yahoo.ca header.s=s2048 header.b=dsXZeNMQ; spf=pass (imf17.hostedemail.com: domain of alex_y_xu@yahoo.ca designates 98.137.68.206 as permitted sender) smtp.mailfrom=alex_y_xu@yahoo.ca; dmarc=pass (policy=reject) header.from=yahoo.ca X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: DC3A940005 X-HE-Tag: 1649884442-798339 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: This restores the behavior prior to 258f669e7e88 ("mm: /proc/pid/smaps_rollup: convert to single value seq_file"), making it once again consistent with maps and smaps, and allowing patterns like awk '$1=="Anonymous:"{x+=$2}END{print x}' /proc/*/smaps_rollup to work. Searching all Debian packages for "smaps_rollup" did not find any programs which would be affected by this change. Fixes: 258f669e7e88 ("mm: /proc/pid/smaps_rollup: convert to single value seq_file") Signed-off-by: Alex Xu (Hello71) --- fs/proc/task_mmu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index f46060eb91b5..d7de4584a271 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -883,10 +883,8 @@ static int show_smaps_rollup(struct seq_file *m, void *v) return -ESRCH; mm = priv->mm; - if (!mm || !mmget_not_zero(mm)) { - ret = -ESRCH; + if (!mm || !mmget_not_zero(mm)) goto out_put_task; - } memset(&mss, 0, sizeof(mss));