Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1846597rdd; Thu, 11 Jan 2024 10:55:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IE9b8eXGf6YX2jKGPQUMYQcysdx8hLj8cozYYwdx6GiOrLuzr6kXjJvx/YeRTboFCH3kp1N X-Received: by 2002:a17:902:e881:b0:1d5:7316:c899 with SMTP id w1-20020a170902e88100b001d57316c899mr163047plg.14.1704999357794; Thu, 11 Jan 2024 10:55:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704999357; cv=pass; d=google.com; s=arc-20160816; b=Mgm4R9a6EK3QFHtydxRzMPY1BVhFYkJazfDMJ41RF0axde89KIGUUk+DR21rIBMONm 0dnavFk2NfaQmoqEuyml2svS7AizhiLQ8x6aJCJTbCFlw1EmwuKt4f1dAP4ZqmFfBnGM jkxqzjIF4jTgrnIdDPzampQjEOoI30iN22fLAC9ygxOLUKnR6SyO/i1DmHxQyebmJ76Z e5wgpOtu4x8hHW6E5/3YuPyHZ23ps3skiJ9nQzXaKVTG7pSBdqbt8DJwMKrMGELiI53e TRtMANc2VYJ++OYY09kd8kYKtIoz3JKhQTbcfjvy7obcLKR0J3/meqQPmBLJ9k0Szp8b qQyA== 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:references:cc:to :content-language:subject:user-agent:date:message-id:dkim-signature :dkim-signature; bh=rKfRgwMZmlF5BvgPh1uNNR4Xnjo5ctCVbqxS8IV05p0=; fh=1KbZhn5+Ql/yDzvb7hL3urfcPJ9RRI+HIvPuxe0EvDA=; b=MkUhX8eGMnV0y3dJNBjdvUbk+k4jXB6szvR5v6PYMISNZmtN7d8x9/+fKyWv6Od1Pk JWVLPhvFEZLv/3YwXrCU6yN0BaOrcG/+XNyt5hwECyoWkezDr8/98S9XQnllL+ODLYcG fAq8lVT5wkEiYfKr1aLLdsE4bXVPj4awpWXJrLogz6kGbRHC+aQm/us2zegM++gCnkmR JsWxjGJN5xtDHda1HHqqwrA2373B7CfEkNH6+8ENv1a6hnYdoCYK4agZgpdGTrMPXyJe 5t5rxbDchG4Newzxi3c3/r4YzjQ5xLL3DQet3d1PojMIygXGmXN3lwDTmJmSEhompjQm ijXw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=GmRNYWxN; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=qC9MwQNb; 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-23994-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23994-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n11-20020a170902d2cb00b001d0087bbf19si1801874plc.440.2024.01.11.10.55.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 10:55:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23994-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=GmRNYWxN; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=qC9MwQNb; 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-23994-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23994-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A6D80282A52 for ; Thu, 11 Jan 2024 18:55:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8AB954BD8; Thu, 11 Jan 2024 18:55:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="GmRNYWxN"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="qC9MwQNb" Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 BDCC818E09 for ; Thu, 11 Jan 2024 18:54:58 +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 (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40BHs6Om027571; Thu, 11 Jan 2024 18:54:51 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=rKfRgwMZmlF5BvgPh1uNNR4Xnjo5ctCVbqxS8IV05p0=; b=GmRNYWxNG1CGIecCeBSDS+zwfj6DUsan98HxLgkYGHK1JkKEQHEc8EcuyyY7kNeE2eCY MtcKRHT8l2X8NHNvKUzgbOZ+/RdNC6iK0YwF8deRrxzPiaJE/iTcfEhN+iEtpG1mEA3w qqpsLEusYeA6jV0hbGqm5/zrnca2MwFSuzlf11muqCOdZAt+9J6L9PnSwvBmTvu7KBKa 1sCf7CbsA75B4mI2TJwwqqRs/RgI7ju7Dqs6QI0XXx9OOC3RWvdzF5UA0GhqYLXYZ+/r lJ410Dnt5+g5pa4VLEqPEYU8BLWS/HpGceo4vKGoKp6hAYRArqHy8yzHZPdo/19MYaez Ag== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3vjjb6rpsm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Jan 2024 18:54:51 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 40BIZxCF012162; Thu, 11 Jan 2024 18:54:49 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3vfuwmduuc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Jan 2024 18:54:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lPd6xwqWkYJ1tuEfzPwUs4rPNJedwmcgWNQfuYOt8zIQmTuTN1ld0VbljIMmjgIOy2Fus51/qg1EEaIyPUyTq6tKWbBzHX6eUhtbU0jKsR3Nyf3JG+7GAZukIFFaaOY0yc0W17tG68f9U3Zu7WqIWmftOsS4htNeawsJQ6Q88i9RsUh8qgDeqGaAes3o+kUcFYUDX4yG9TF4/NdvSAIXNcEurRHHP/usBMQDZEnYjem7YKqAnT0M8P7qCirAP+ROTZ7INIpiQ9M0kIeX6dzvLyoandmmiP9EjZtdAwWTabN4YWQfeXBh1a9hUILWsq3AEWNM9QVNl9dLO0GCJxn37A== 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=rKfRgwMZmlF5BvgPh1uNNR4Xnjo5ctCVbqxS8IV05p0=; b=n989KJF8mJo0fW2OBb8jLSgHHxgYTgVN3F/6wRpP7VCQrI3t+/whqsp0+g4r6R7PyU3UpJxIpwDiWwMhk+4NwbfhwI5Oa778OKOdppjzQs+rocTW7dj1cQcpR/zqSvP7ZH2BZ0HaR5d/w3bLU3UQA0sQ6Fal2Y1b3uCb1MWAepK7TbGBBkUao1+DI9eKzHiPhzlVPC1xXzHj+Agi7svZ6tTWQBPaO32AcGIB82kyZTTwfMq0dyT6hrmAfYTtW6UM4JRQ31lHNcybYG1dU5w2ZiosGulMgTtcarBeTbi3Us8m914224H7A0xWIPTjWDlo5RyPfwuH113FVNxqfHLTUg== 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=rKfRgwMZmlF5BvgPh1uNNR4Xnjo5ctCVbqxS8IV05p0=; b=qC9MwQNbuDQsuCBeNOQmJhUjBehrknm980K5+T1mdjya4qTZuherXYE6eRGaVTk9yqnesdeRYTjq0hzhhcVKjFOoJs8bA1FkgyBQUnW7aQ7fAe/aA1AFzQwzm3tP38lzLr2jlRA/hYE/+UkcfkDLue7Ju/gBfhLg7cCANJadjes= Received: from MN2SPR01MB0026.namprd10.prod.outlook.com (2603:10b6:208:cf::18) by CH0PR10MB7437.namprd10.prod.outlook.com (2603:10b6:610:193::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21; Thu, 11 Jan 2024 18:54:47 +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.019; Thu, 11 Jan 2024 18:54:47 +0000 Message-ID: Date: Thu, 11 Jan 2024 10:54:45 -0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm, oom: Add lru_add_drain() in __oom_reap_task_mm() Content-Language: en-US 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> <1d866f1b-94b3-43ec-8f4c-2de31b82d3d1@oracle.com> From: Jianfeng Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MN2PR05CA0009.namprd05.prod.outlook.com (2603:10b6:208:c0::22) 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_|CH0PR10MB7437:EE_ X-MS-Office365-Filtering-Correlation-Id: 839b779a-0701-430d-fe03-08dc12d6c893 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B9FIrcND9FglEnARSqr5oaheJrQiE2TTYUN+22J8g86MPGCAvmjr/8W84DgugF4YL2nOiiRzEI1F9ui4DLbN1fTZQsQW3Y3uVONct31d1QQkpXm60JqvyG2lgJboBw/vA9zrWWtIb3afbsb7aRjRN/SKQKFBV/Bs6TK0D6ZZmPv7F9ZBXkGwH/enyvJGZE3x4OpHCKQ65D4BKY10QtvtHKRDKttnRBRipU3FIkpuGmZiadHicTk6ki+qTjK8CPwBZG48loBplD5FDWIb8vcLCrQfXY8obIqRu4gr8C3ahShooXJSU8RqxbW9TFeWnZKB/bLOHHje9wn0ZVBa508DOraYRpuXOI4t4cef27fGuz96nhPG+UcLpFKwotorRLlEDaN6Wu7y80R9MazKDqXtqZeM9F7joHwcpxJQWEcHWOH/Ow+ueaoYInrPoHGSb6Nh2WsWIN4XHLnHhyLW4FPrz66cpvB4m4HwY068Iu50Uu89APSrsyFznJOG+25P4WJqwNE6JY22fzq9cn166iF6PvduXGdJ7GBc4gLdytoPjRa4LYfbZudBzllzYMUw39vUY/yiYd+B/hucD78TX/oNtlC8c8i/Kwv3kHTU/dYZHf0TNzjWc4IF/WZo+lzmnpnF5kzCu83iXVgsRsFK5WE2+A== 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)(39860400002)(346002)(366004)(376002)(136003)(396003)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(26005)(2616005)(6506007)(478600001)(6512007)(53546011)(83380400001)(5660300002)(2906002)(41300700001)(4326008)(6486002)(8676002)(8936002)(6916009)(66476007)(66556008)(66946007)(316002)(86362001)(31696002)(38100700002)(36756003)(66899024)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1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5yecLc/HK8pa3ZUnD6Wkinwq1hpfcaSeGT4/ySgFejreI++0NvXvnt7gP3g0/apD4LDriNKURyb21aCbxAIg5vXKIXxAUyvVbXy+mLDg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 839b779a-0701-430d-fe03-08dc12d6c893 X-MS-Exchange-CrossTenant-AuthSource: MN2SPR01MB0026.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2024 18:54:47.8364 (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: rMiK3yRNC2Xu3zqk+d9Podw2CFiG9VbMbDv6NoXrGLUwqBrYJbF322LyVveDRVaHTZSDkuvMURaZLFf54zjfNZPF2pqWKql6LqNQ///bT0A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB7437 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-11_10,2024-01-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 spamscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401110148 X-Proofpoint-GUID: MFrnyKBCorDDXkv9WWkxWbZVo2QaVHL4 X-Proofpoint-ORIG-GUID: MFrnyKBCorDDXkv9WWkxWbZVo2QaVHL4 On 1/11/24 12:46 AM, Michal Hocko wrote: > On Wed 10-01-24 11:02:03, Jianfeng Wang wrote: >> 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. > > I would argue that consistency the biggest problem of this patch. It > tries to follow a pattern that is just not really correct. First it > operates on a random CPU from the oom victim perspective and second it > doesn't really block any unmapping operation and that is the main > purpose of the reaper. Sure it frees a lot of unmapped memory but if > there are couple of pages that cannot be freed imeediately because they > are sitting on a per-cpu LRU caches then this is not a deal breaker. As > you have noted those pages might be sitting on any per-cpu cache. > > So I do not really see that as a good justification. People will follow > that pattern even more and spread lru_add_drain to other random places. > > Unless you can show any actual runtime effect of this patch then I think > it shouldn't be merged. > Thanks for raising your concern. I'd call it a trade-off rather than "not really correct". Look at unmap_region() / free_pages_and_swap_cache() written by Linus. These are in favor of this pattern, which indicates that the trade-off (i.e. draining local CPU or draining all CPUs or no draining at all) had been made in the same way in the past. I don't have a specific runtime effect to provide, except that it will free 10s kB pages immediately during OOM.