Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1930806rdd; Thu, 11 Jan 2024 13:54:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgqyY0zjFGUVy/owEYD5gMx8gqVkNk3wqfwlCv1S7TqNU/ItByPY3i+cv9rsusshnjhYpP X-Received: by 2002:a05:6830:104a:b0:6dd:e798:f73c with SMTP id b10-20020a056830104a00b006dde798f73cmr450513otp.50.1705010053457; Thu, 11 Jan 2024 13:54:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705010053; cv=none; d=google.com; s=arc-20160816; b=NgJvVJAehMhrDNa7ciNSlzYWAFLX/LGfTbB0VpyRTJ3Lm2B4lxaCH32iXQ1knbzRp2 zLDe5sF/YqbnrYxgug8WgAeNAlYb2Dr4cJJw2JBT31YRrltR6FlM8/xu5tMyuAdfUbuK THS0c0wYN3ZtNENbbRXvWABtkpqO7i2iF3yjBCLYiGAx9o6QEwYXLu6HPWMYjAL7OZGw qoZJFYI5ujNPO2c9F+gAPrB7FJK6n44erXECacrMUCvrhx4FfJl+PToJXst214K9bIV6 1roNRa8ukaRy9xf+M9taVQ09+yyp/aya9OseIYKOVmbrEB/RQ8+PSBwmMFy5hJZC9yKp E3pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=kUaogiY41+ofznU9sRm/iSmZURHs6Dl504WlsnAs7uw=; fh=DJnZba+nu6MenFGfE+fQxdCK7qKbohuCxpoodptdHoc=; b=JLfv3lY8OXXcDIg7SAUxNAZre6seoK5IiMQHH2FsSIGbhC7b1BTqUuJe1wmr+qHwMp Cl9QG1HEcCQuwFQZdmo05ePoRH5ylIdED6FK0JDKKqd3f5IcK2rnbEHWMvwqsx9XBk2o 0n+Y6vDKzc3lqSSZAl3O7Emls6XuLdD0eaXnTIasjnDC7CbQ1wu3wTTZ348Rcax9mDeK pAnyLRMbMbRNDOcTIpD5n0jyn7cCGOn+qJFkeMRdXeNAA35SFarCwiFGQkflJITQXxTj r8bimzAVCUrugzQR5ESFN2IGYaOAbUhH9c7jZPv1RFbZBiJBlRCpacopwLaAlWi97VIT 9HPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=xet3vbjy; spf=pass (google.com: domain of linux-kernel+bounces-24101-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24101-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id n6-20020ae9c306000000b0077f5e12ded1si1728865qkg.618.2024.01.11.13.54.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 13:54:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24101-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=xet3vbjy; spf=pass (google.com: domain of linux-kernel+bounces-24101-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24101-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 373841C24422 for ; Thu, 11 Jan 2024 21:54:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28B025820C; Thu, 11 Jan 2024 21:54:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="xet3vbjy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1D1A456B83 for ; Thu, 11 Jan 2024 21:54:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 518A8C433F1; Thu, 11 Jan 2024 21:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1705010045; bh=5T6qmUEqSEe0y8Obv/o5UTTw7CLDO4G0csQ596TuakI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=xet3vbjyx49+zfrk6MoGZp+RE0E2OV0FzrKZ0ZXmFapYLTO35UsS1r5wNfkz/t7Ci WJPKnqknMB31sMqW/lhl4CfY/mRU88A/qTLaNF0sg2Z0Eq06Ry54XJPDv0c37pz6Zs QrkOb2PFKYrp1Ufezc7HHacf5qcOkOpd4lFQwQq8= Date: Thu, 11 Jan 2024 13:54:04 -0800 From: Andrew Morton To: Jianfeng Wang Cc: Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm, oom: Add lru_add_drain() in __oom_reap_task_mm() Message-Id: <20240111135404.609af4a26d0118c0d290f11c@linux-foundation.org> In-Reply-To: References: <20240109091511.8299-1-jianfeng.w.wang@oracle.com> <1d866f1b-94b3-43ec-8f4c-2de31b82d3d1@oracle.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 11 Jan 2024 10:54:45 -0800 Jianfeng Wang wrote: > > > 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. I don't think it's necessary to run lru_add_drain() for each vma. Once we've done it it once, it can be skipped for additional vmas. That's pretty minor because the second and successive calls will be cheap. But it becomes much more significant if we switch to lru_add_drain_all(), which sounds like what we should be doing here. Is it possible?