Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1180715rdd; Wed, 10 Jan 2024 11:02:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2KokGXYosJoiU99waBhYdHa68/5bQ4HqBK/S9U67zaBGWY1Xk64xw/ivFyGWzo6ph2sVe X-Received: by 2002:a50:ccc5:0:b0:557:5162:4ffb with SMTP id b5-20020a50ccc5000000b0055751624ffbmr669312edj.50.1704913347412; Wed, 10 Jan 2024 11:02:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704913347; cv=pass; d=google.com; s=arc-20160816; b=fNHXIznY3zSah0dtknG8dpCfUWlU5VlGnq3PxmSN6rnXmqfA32jr11G5MlQR0WSHNZ ni0RO87O8oAe3+6ENCcdX7ufgPwI++4qNn6DbN1xtdXxA651chOc4QesHnQ0yPzqrnTI /Emfv9K2FZwxZCWrr2DlTTWIom6qK+sTMx++O8Ab4L4sr3OYA8YnilFnd9joFZc+YfBU GaaSYNIg37JYLSNum0eHdyF/UsFeyp5VrOuBWGeVgPDmBwhNr6ttsXc55HVaLtgErJ4P +SV4vnbA8MvydD/lSblq8ImThse9SVxLtpvHMxqeanFPSwQvZbyLVi0PeKf0oXsnwDhX FEjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:date:message-id:dkim-signature :dkim-signature; bh=VSgqL8fxgdGS4Ui+EL2Xl04XhTM9mXTC3F5bkf6j0E4=; fh=1KbZhn5+Ql/yDzvb7hL3urfcPJ9RRI+HIvPuxe0EvDA=; b=ySSQmtlUA3uEft6RTb8koy6c46QNT/ou0dyLKR4qp/V/ASJhWv177IL+z2ytpcP1T0 gIRCtduwgsdwA/5HviGZaGlSnwG2WR+ynMb9SnCLTHp7vL2lNwGNJcUpGkqCzwoBLO7u 2whhiD8/2u5tvro17sAb5ETI4gsqdULC15fvq77C/TwZm/BoFMpdFoggu3IeBpQguCEo mQyfmcCkDTH7S/JZjmWs+a5MEZIg+EMqNCvVcRMjw8PkD62JQFCxdWKAxBZXBlmn2x1c pxjFLctCKK5ghknDKPdEnBNC2TRiyBZi9oAyMb/0hOq+pvFIc1CdvPxPjdm91I5DCXI7 qt8Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=cwRmSYe8; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=A6G1OK3d; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-22628-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22628-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t29-20020a50d71d000000b0055446bfa4bcsi1919811edi.346.2024.01.10.11.02.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 11:02:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22628-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=cwRmSYe8; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=A6G1OK3d; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-22628-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22628-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F08901F225CF for ; Wed, 10 Jan 2024 19:02:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED1A94D5A0; Wed, 10 Jan 2024 19:02:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="cwRmSYe8"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="A6G1OK3d" Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE8374D596 for ; Wed, 10 Jan 2024 19:02:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40AHuFFZ013759; Wed, 10 Jan 2024 19:02:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=VSgqL8fxgdGS4Ui+EL2Xl04XhTM9mXTC3F5bkf6j0E4=; b=cwRmSYe8A1FWnn3vgResFIHZVWqb4kHX8UDGVyzmZPY4QALJR44WetZStqfQvx2Zx8Uz dDlQhUKF/asv+SbsMkBMZMB+FA22F00WGKbeQX9M6/yuGlaRQkGYHnPnNB4M17jSHuz5 apsTF25jp2JGnqemjJfl9j6GX275b7QM1YvK28y7UzMocs8jo4tzCk7M/sHnmZ7+ZGd4 QLmBGcX2zQCrBrKJCerLvA35qsq2pBhvcj995YlmZW4vwm0prbfZ74IgxRp3i2D9RnhB GUWi4j8Qiep7o+Rae1kBSzmJ5+9+ep4uOikK+rMYswysuh8JnLFC+uwH9BsJDh2mzltQ 8Q== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3vhs1x1456-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Jan 2024 19:02:08 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 40AIhNPH035185; Wed, 10 Jan 2024 19:02:08 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3vfuu6j01u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Jan 2024 19:02:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V9dLYsPDvG8CUyic/MzzuFOGyFOoOh0pq+msST/aFNml37EhwuyYqvVres9Ero469Bi1UFuPoQpRETfmdoQe6ZKjl+3GfqG+YaheFXDFfLctC0ofbWWEvTXJ5fvYLl7zrFa+Xsy4WavCd3vkETe5s/2WcDg6mGwV6snpXFEDjSWL1eY9+eJKZzyr0HPcxZ6qVdsSdMvrK5YKlSm1+HQAVbzEKisoKCxMxLD3K8f7zvMrn50l5y+cDvDdYK/pa9FM1nFvEdn3zKF+Om0RuBIJ91sBJftRWmPIZYb6Rpa6dD4nQRbFZVebFIXJzh48VDBm2iT2IV0OZ/DRng+pAG+5AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=VSgqL8fxgdGS4Ui+EL2Xl04XhTM9mXTC3F5bkf6j0E4=; b=aFc782N76VNqynjy/hO6A0fFg9sd5x7gFuetLj9avE9ItV2TXqEEOzP4eOkp49jSHHLytErwJ5VL0lmMEOTT+js/eSdruWd9B1z2cLNETqxZo6pHZDU4zMaZiuUcB+ZaayHr2HGWymKqLvkjFtzwlvYjL9ZDuLkHUYxRfI8C53JXdn2cVlHQpNKKyyGhvZHaGIMDr+8CAK/JCIYaALrpXhRfhfKF8jwvExFW8ZbVnJf83Pub+xunEmYkShpFtWA/v72UolQwLnrpNfRLxOaVuhA0MSvuaiis2RpBaM2x22lwaDG0EQK7Luw4WW1kRKmR6WDjRBuCNHFPOymXuquHyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VSgqL8fxgdGS4Ui+EL2Xl04XhTM9mXTC3F5bkf6j0E4=; b=A6G1OK3df/GyXjf/GVFjNui5kFk9qKjWZ2N4+rsXOxrmEqig8KfR3878KIF2kM2Y/P0giloBu0GsqDdJzy2U4/4bVuw+xmxM5K2jDBuKW5BR14vgqcYpnAKcdosIGlKP+F51tkQAeZrEIJVuQHYqFoXcZ4GbAlWhHzPbNxbYa/U= Received: from MN2SPR01MB0026.namprd10.prod.outlook.com (2603:10b6:208:cf::18) by SA2PR10MB4732.namprd10.prod.outlook.com (2603:10b6:806:fa::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17; Wed, 10 Jan 2024 19:02:05 +0000 Received: from MN2SPR01MB0026.namprd10.prod.outlook.com ([fe80::7dbd:113e:6ce0:23d3]) by MN2SPR01MB0026.namprd10.prod.outlook.com ([fe80::7dbd:113e:6ce0:23d3%7]) with mapi id 15.20.7181.015; Wed, 10 Jan 2024 19:02:05 +0000 Message-ID: <1d866f1b-94b3-43ec-8f4c-2de31b82d3d1@oracle.com> Date: Wed, 10 Jan 2024 11:02:03 -0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm, oom: Add lru_add_drain() in __oom_reap_task_mm() To: Michal Hocko Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20240109091511.8299-1-jianfeng.w.wang@oracle.com> Content-Language: en-US From: Jianfeng Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR05CA0012.namprd05.prod.outlook.com (2603:10b6:a03:c0::25) To MN2SPR01MB0026.namprd10.prod.outlook.com (2603:10b6:208:cf::18) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2SPR01MB0026:EE_|SA2PR10MB4732:EE_ X-MS-Office365-Filtering-Correlation-Id: 1837f3f5-1b44-424a-ea73-08dc120ea306 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V/P3aa4Unx2Uv2QG9V0n37hIlY+r8Meg0Vjd0XDaAduk6wAH5Z+xOVU+CD+SFTWNpCgvwaGnKrWUQxf7lGv60RPPu6kcvXIHKQTHBZxTsOytqn3yOg9eT+iDblNXj8g1mbLP0jAOYGezxogxo+JxW52CRxeaW4IAnNhwKoNcjMZIJ5i8P07bY6MTmN9a9ScDF4F0/GHEORgfpROuXkBiEtmKvwmbjQJaDcdhluCItDT70ZUOp6zsRYECz9NdOy7kPpOzwFfCUixkRmceoHEyIkA3MhyqEXazWpyHS8W9H7HSAzfb568aINkMxZntiJGc9iaSQrzNAnJ7wJi8zRvwAknQi7Aef8fa6LzaR1RcbwAdUPjLiA4gr29YfEy4yA3Qd3BEvgle+tkt2nWOl+P7XSsSRkpuleP/QSl08F4NjKk2qDRBWPDH4nymTKBBEscSjGI3h/NDTZ8PW1W46gcvpQf80zNK6p4gzbntwxEQ9n+CPcY2D7miozIScmUVWD2eZZQUgRqhVZyms1sYnXVoPbsw1dAgZCKY99nz3tD/UJ3rJHahkbkZMTo3q3AnPYhbi1NnXo8im7vET+V9d8XBvc7eqdxdLtamPc8UDljBH8fJ8akfqLZhuzhyMP6He1XVlke7wzknjgR4QFNZ9uea1Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2SPR01MB0026.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(376002)(39860400002)(136003)(346002)(396003)(230922051799003)(1800799012)(451199024)(186009)(64100799003)(31686004)(41300700001)(2906002)(4326008)(66899024)(53546011)(6506007)(478600001)(36756003)(6512007)(8936002)(8676002)(5660300002)(38100700002)(31696002)(66476007)(66556008)(26005)(6916009)(66946007)(2616005)(6486002)(86362001)(316002)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-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iIB2y5LmWiDYzuH209Ak+1JhzgEu0Y4LsbD+FvBizmMEbcAoUT4QIEP04zMU+ivk1X1P4hUWyBrsLLIL9yprpJDBTDDj6J+iq54P9aLUFKv2cGmZKwjjuZCgeWf1he1hxH3FrbinQX7BNTqV8jeDqPh4h25HW+8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1837f3f5-1b44-424a-ea73-08dc120ea306 X-MS-Exchange-CrossTenant-AuthSource: MN2SPR01MB0026.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2024 19:02:05.5576 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SgUjk97G21OzrySsi4m4EuNwIdjk+bwPwzVVIOWO0TA5jdC1eyDKFyF3yY6cbYXKEZXvYCYHYHfo97xgyV7dQm27APRolf9AUHxLKeAUw5Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4732 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-10_10,2024-01-10_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401100150 X-Proofpoint-ORIG-GUID: 377hpacGuYWh-AfQOTnnX9-ZgMOMA6sG X-Proofpoint-GUID: 377hpacGuYWh-AfQOTnnX9-ZgMOMA6sG On 1/10/24 12:46 AM, Michal Hocko wrote: > On Tue 09-01-24 01:15:11, Jianfeng Wang wrote: >> The oom_reaper tries to reclaim additional memory owned by the oom >> victim. In __oom_reap_task_mm(), it uses mmu_gather for batched page >> free. After oom_reaper was added, mmu_gather feature introduced >> CONFIG_MMU_GATHER_NO_GATHER (in 'commit 952a31c9e6fa ("asm-generic/tlb: >> Introduce CONFIG_HAVE_MMU_GATHER_NO_GATHER=y")', an option to skip batched >> page free. If set, tlb_batch_pages_flush(), which is responsible for >> calling lru_add_drain(), is skipped during tlb_finish_mmu(). Without it, >> pages could still be held by per-cpu fbatches rather than be freed. >> >> This fix adds lru_add_drain() prior to mmu_gather. This makes the code >> consistent with other cases where mmu_gather is used for freeing pages. > > Does this fix any actual problem or is this pure code consistency thing? > I am asking because it doesn't make much sense to me TBH, LRU cache > draining is usually important when we want to ensure that cached pages > are put to LRU to be dealt with because otherwise the MM code wouldn't > be able to deal with them. OOM reaper doesn't necessarily run on the > same CPU as the oom victim so draining on a local CPU doesn't > necessarily do anything for the victim's pages. > > While this patch is not harmful I really do not see much point in adding > the local draining here. Could you clarify please? > It targets the case described in the patch's commit message: oom_killer thinks that it 'reclaims' pages while pages are still held by per-cpu fbatches with a ref count. I admit that pages may sit on a different core(s). Given that doing remote calls to all CPUs with lru_add_drain_all() is expensive, this line of code can be helpful if it happens to give back a few pages to the system right away without the overhead, especially when oom is involved. Plus, it also makes the code consistent with other places using mmu_gather feature to free pages in batch. --JW >> Signed-off-by: Jianfeng Wang >> --- >> mm/oom_kill.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/mm/oom_kill.c b/mm/oom_kill.c >> index 9e6071fde34a..e2fcf4f062ea 100644 >> --- a/mm/oom_kill.c >> +++ b/mm/oom_kill.c >> @@ -537,6 +537,7 @@ static bool __oom_reap_task_mm(struct mm_struct *mm) >> struct mmu_notifier_range range; >> struct mmu_gather tlb; >> >> + lru_add_drain(); >> mmu_notifier_range_init(&range, MMU_NOTIFY_UNMAP, 0, >> mm, vma->vm_start, >> vma->vm_end); >> -- >> 2.42.1 >> >