From patchwork Wed Jul 31 13:33:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhiguojiang X-Patchwork-Id: 13748805 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 44A63C3DA7F for ; Wed, 31 Jul 2024 13:35:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D61CD6B0093; Wed, 31 Jul 2024 09:35:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CEAD26B0095; Wed, 31 Jul 2024 09:35:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B15A16B0096; Wed, 31 Jul 2024 09:35:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8ED666B0093 for ; Wed, 31 Jul 2024 09:35:27 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 469091203A7 for ; Wed, 31 Jul 2024 13:35:27 +0000 (UTC) X-FDA: 82400144694.02.ED0AA5D Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2055.outbound.protection.outlook.com [40.107.255.55]) by imf23.hostedemail.com (Postfix) with ESMTP id 5CB9B14002B for ; Wed, 31 Jul 2024 13:35:24 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=mliT2B7+; spf=pass (imf23.hostedemail.com: domain of justinjiang@vivo.com designates 40.107.255.55 as permitted sender) smtp.mailfrom=justinjiang@vivo.com; dmarc=pass (policy=quarantine) header.from=vivo.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1722432896; a=rsa-sha256; cv=pass; b=H4c3mPd7VLNJF9A1ViHhnCsfuGWL7Vs7WWu6eipmUwCT+5COf58CduWgZa/a7pRYOBxdmQ ynpexQb3VRvHXuWdPN+KMCtxYpXDHgigtKOjYY6YFfHX3rwOIGRcV4NZDlnDHPAd3AutbG 0IR+EolOemRUCnRCOPHgjxq0xuzfSyU= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=mliT2B7+; spf=pass (imf23.hostedemail.com: domain of justinjiang@vivo.com designates 40.107.255.55 as permitted sender) smtp.mailfrom=justinjiang@vivo.com; dmarc=pass (policy=quarantine) header.from=vivo.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722432896; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lyxFrc6Clfrofhrb3kvsAmejA25jBTP+9YIvp/aeLhU=; b=VFDgMAqwMndRu7QPAUOj5ic8XXVrkIVhfuDhzNc+x9S6ukmOlifvfJpfijhloWJuivxqtm Y1FbJmY8wnJBndMdfZSW1Tv/YKO5kCMET1YLSNo87fQaXL9YOinq1JH7ydi042VxOJqkRs /WdPJz6ILKpu53dkiIHVbsPt+zQo8ak= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wyg155LufuVX4eGFF/0cX0V3abhdfgQa1lnTMNA0Uc96kQDO4W49Ke0cixnSt+vQ0WE56oS1sM0LK2O8B75UVfAcDbf4WbPJ+88sjCh1JbJk74aRYw1MEdit9CCGq/bS9pQb6EEu14KdhKJrMrAImLRQ72YFYPdC1sU2x/IBKkTp9imp3E0aZPvIB4qEsxNMKSlplY9c3Pp6F2FdrelsYs1Rjc+ESVWq5dFgg8sfqtfI6ENfVHxZRO1iAXwm64cKT8LXE+FM0mEDUYUrI75jIMqMtlSji8cdu/t7ELnmzJ2trrhfLjG75JZR/uYMVf22ulyQBdp9EQfE4QVf36Gy3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lyxFrc6Clfrofhrb3kvsAmejA25jBTP+9YIvp/aeLhU=; b=hxWM9XcSAJTzsa97wiINYEpO6p66Vqq+HbbtuiSblvdw7hWS92TFKxeikV1unI7oPx72ZrHsP7UJpqxDoazSdsMfJCqud9vwRlNoWxYKTOfdKDuKlY61kqOtbsICBqY4M0+NHMH3dpO7iLNgb5tU50oHeNHlSqzIkf/KP7QVnkU0OkKZfYq4BSiqDb44U/+DnJcJkgke8nN1sZ7NC2TzuIsjYPED+z+7/z/rScDLDvm+FnvknTtcqWemAS8cHnEWr9riFu7I6yj32pZkW1mBMZzXrMnoCfapCt3kaWxeZHlJMDetx2/NWaco3jFLlTMfNSIKFR0gWsw4y0QOrVjrPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lyxFrc6Clfrofhrb3kvsAmejA25jBTP+9YIvp/aeLhU=; b=mliT2B7+DK5nLl1qGxYmhcmtArAFoDwiIUCYjr2KevP/VQmrOY/3ivqJXzg0mcikQxbO0B9QZPUhIUpk/fl101zdVIp9HmWzLFfWI0U3PWFlqPS9tTtNHp2KNXfujA9IxZ3+5wyyc9YjDPRl8WNmuluH5PRgJkpP1vOJIX6N8Btjvsyu2nstoPJmS3KvHcL7hsS0EiZplQyF0WMuYLElv5/cXPe1b1+zaAHbBv/PxpW3AldxuHnnmMx1Vz5kHVa0xp2oKfIMm4xhIW+HIp1xNMxN2JjJQ4HY9cIy2Rf8hVEon85LWj3GVMQ2wNGB5JMUTKAoIlREieRaQUbQGKkVEw== Received: from JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) by TYZPR06MB7334.apcprd06.prod.outlook.com (2603:1096:405:a4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Wed, 31 Jul 2024 13:33:28 +0000 Received: from JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::ed24:a6cd:d489:c5ed]) by JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::ed24:a6cd:d489:c5ed%3]) with mapi id 15.20.7828.016; Wed, 31 Jul 2024 13:33:28 +0000 From: Zhiguo Jiang To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Peter Zijlstra , Arnd Bergmann , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , linux-arch@vger.kernel.org, cgroups@vger.kernel.org, Barry Song <21cnbao@gmail.com>, kernel test robot , Zhiguo Jiang Cc: opensource.kernel@vivo.com Subject: [PATCH v2 1/3] mm: move task_is_dying to h headfile Date: Wed, 31 Jul 2024 21:33:15 +0800 Message-ID: <20240731133318.527-2-justinjiang@vivo.com> X-Mailer: git-send-email 2.41.0.windows.3 In-Reply-To: <20240731133318.527-1-justinjiang@vivo.com> References: <20240731133318.527-1-justinjiang@vivo.com> X-ClientProxiedBy: SI2PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:195::13) To JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: JH0PR06MB6849:EE_|TYZPR06MB7334:EE_ X-MS-Office365-Filtering-Correlation-Id: ea452106-f2b6-40ab-a08c-08dcb1655cbd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|52116014|366016|376014|38350700014|921020; X-Microsoft-Antispam-Message-Info: R7+Gq8enhSWUiHDdpLEDJfkl4ilHVQVdUr1XKj9MG7b9tzwF7GYT8hSKeKAjQ8X0tBHcIyA7mD0qD4m2pqansTNG1xArGa5OgAN0lEePSJepdFt7tDRcAi1GHoczXZpomW/ez2wkbg4C9b/+Rh7ZYOn5BbI8SEJ04p0ijOBnHmlSzUfqQnhm2gfhQ2lrh+N2Cs/n2B7bp9QBIQeJVYMgsVfhdI9/CyBjOyMAwO3qQBO6BPKaF3gL9gd5FN4nkdUTjEfwhw3iutRWQwobI7Gxz2WJRGWQwC33hV213knlIIL7ubI8ZTjnK0Bo4i0BqCYvz6vILHEGX4+EHQIQlESniXKBrcSLWp5BJ99w/CD8nIAcfobaW67jmADPAOe6DoONW/fOybRX57CxsFZVB9TXCY2cohXLM/9kNQbVZG0VrOGJOtAPoH+YMHVuYudonpspri0PIe/pCajLUDyoEAfi6N7wqEhAekQsiP/uAs7sR8tW0Y+tStBC/hs0BD6yC0beaHhjZRUaFkcPx4l3M200KaIcoxU82XnpVTmT6m/V+1rMyUgDmkOtStMci3+DETDkCCyxV2W35V1VfVnS1nRP03rPYLCz15s++3zDAFuK2SQYNgx5fI4O8rcIp/aQk7jB5axUcL9DM4AIwM0FxFd1obwW7mUpg6U/+8HbDwPbNJxTDypzvq2MBVSE1iuGgJFr0lxRngZtxbvqbAmWx2xTcHLHVQF3lq4tzqAw3ZxLpSlBhpOAhyY4w+kPyqSKK3UfcDgqLPVKBfOmrOusNCJ2qyX6ZGW6b6dR6jLofve9jbF+y1CiGuk+kVb/y5Z1ABYYpVztQ8D5fWN1SFJU5qGg1MoOS+JzX+3asr8QD1O0AC2aF69B/6CXYHX0VLETzjt5JvPYRR+yHQ9Ohr+qmXz2erfy3lm34Z7qtNg+AKEws3C5PHdcKAHa+/k7lg78FzYTq84cK6Pf1nTc/2m18FtSvpQYTrGFD9aSc1NthUWRcOowPO+NDtaZhWEvd48NIQsZrnA6osHwabN1rVhYA5+/SXwH1/2KI28vcr1vuDkuSsrWbe4HNdCjFm9rA4elqmSB748yWeORsWBO+LGORc8mrnjkRM4EqIvvh+fXhasumLIOESoBEGf23ekLj71Ey7cvgDtGnrECFztGPgksOnSrXDb5bWhWKmFG0Bp0PjAiRwuzaYhlWeufL3pU1FW7OZU3mPx9nbm90a86Fj2cRQp7IWh2wk9qJE585CNM+2sKyRCQ269gifz+266KShRidA3noOWwefa/S8XCluqDmP4No71k1zSZOAfs0nehYwsvIJF+8NV9B9FWS5qa9AKsmp5L5jKxAEtW1KWOw9RUI9uxq0gGwdnqMzaQAzXPGGHKlphrPS6chZ66o5KIOcEEVAVJ+waFjmDoY7eUUEkCW2jm/+AtOZYGFgWCAQFLa8dw8Ug= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:JH0PR06MB6849.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(52116014)(366016)(376014)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: n6Uy8ZX8UOw9LR60+E3DJH3zgWAXiCDvb9Z4fgYcXXrN2L1qYTaB+/shsEjHMTka+MV8ULkBzEVgPUxdG6l8lCdd9XvS7KwRW6NR0brbp9nVXbreBV7oYfmN/8BWFTH+c+E3roBb4/ankx+AD2Bk9R4PFqWitS9GTxvhD9wbWQX+8uybTzLTYdaoTW8XsLtOYnxlWrHbGp8N0K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pYF2wKge1JzXd7pKDbt9nYiLptGrvbpYa3PP5q+D8dxmSPse6rtwe/UaMqsn1sm5A9U0PoYvMYXfEAknMgs0UvALZIiAtSzMMab6rEOxN2h9br2cS4DruP7ebKD/vB5fEYvisLkNrY+/v0TqKvl5UlfHVlfs/4B/yNc3kDxArEbkWBuGxFIHmphT2IeAevnlv7vK4aM7t4I8Is2/7oS0lB5PWvGrrlwTaPmHHjD9Lp22y6rlUgy74XWK9YNsPtyeUuMWcQJJnKYpJ5wQ0W0MJS1NAPxEx+sqQDDvLWQWPZUNmaKmby X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea452106-f2b6-40ab-a08c-08dcb1655cbd X-MS-Exchange-CrossTenant-AuthSource: JH0PR06MB6849.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2024 13:33:28.6958 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VZQ0hbMmoHrTMOPGbmSTZOVFasdEXeXhH4qqqkuRKxZBg+9RaDM8NEdbgE45htRMmGggI/QP8E3WyjzWZ6iEgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB7334 X-Stat-Signature: c8wcytqcr5dqn7e9w4jitdoqtm7ii1bg X-Rspamd-Queue-Id: 5CB9B14002B X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1722432924-622032 X-HE-Meta: U2FsdGVkX18FxNK+a7Eh3oik3XuCKfCLR3m/hsM5cq3KiHfd6qir5E6Rqj4dRYg/QrCtgtKOdQ+v7qNdW/4IvcW52CaSQpBkTuGm5ikRndQR9Z2cGQXjmigbzD2eObyIVRC8nnPsgmMXdJsMmO6z3MwCOuSF+KfHtP4UHsS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eEqrEFkEfIbBUs34JBNBBJSSH8xU5HE1rUNJYt71WV8pppAJNqmsnEtW0PJhQagcBgc0XvFlC0F0hKl+ldwNHMYHKSJdF 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: List-Subscribe: List-Unsubscribe: Move task_is_dying() to include/linux/oom.h so that it can be referenced elsewhere. Signed-off-by: Zhiguo Jiang --- include/linux/oom.h | 6 ++++++ mm/memcontrol.c | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/oom.h b/include/linux/oom.h index 7d0c9c48a0c5..a3a58463c0d5 --- a/include/linux/oom.h +++ b/include/linux/oom.h @@ -77,6 +77,12 @@ static inline bool tsk_is_oom_victim(struct task_struct * tsk) return tsk->signal->oom_mm; } +static inline bool task_is_dying(void) +{ + return tsk_is_oom_victim(current) || fatal_signal_pending(current) || + (current->flags & PF_EXITING); +} + /* * Checks whether a page fault on the given mm is still reliable. * This is no longer true if the oom reaper started to reap the diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 9b3ef3a70833..c54a8aea19b0 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -98,12 +98,6 @@ static DECLARE_WAIT_QUEUE_HEAD(memcg_cgwb_frn_waitq); #define THRESHOLDS_EVENTS_TARGET 128 #define SOFTLIMIT_EVENTS_TARGET 1024 -static inline bool task_is_dying(void) -{ - return tsk_is_oom_victim(current) || fatal_signal_pending(current) || - (current->flags & PF_EXITING); -} - /* Some nice accessors for the vmpressure. */ struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg) {