Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp14707786rwd; Sun, 25 Jun 2023 02:56:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ox3Afsw873FJ0DMgOJyt8ehHKbP8GALKrXq8W0LDvBV8hQu0/MLslXUGGfavrcY90cRHC X-Received: by 2002:a17:903:1105:b0:1b6:cafa:4d6a with SMTP id n5-20020a170903110500b001b6cafa4d6amr5626668plh.14.1687686965947; Sun, 25 Jun 2023 02:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687686965; cv=none; d=google.com; s=arc-20160816; b=uSAuYcAFsrk4jm2huHrAwqu/Qk0/cTlCxO9p6ODVmzunKDDB9yBX1gIGnaE6TIWet1 6fNcaUa/CFzVOfKdW9IcV9kv9DZh1hnzN6YVT9JSbmQ11W9UOUXuNwwfzcE9x4q+BzZJ Be5PB0l3Z9fROtLYXfhxKP//3T1zHo8RZUDSdKUPMxARYJ7Ys9WgFcM2owq+KnlfXH9P IVxu/6COFrulsU4EIME1zNT2FFReGyZ3ewBG2GAtYufzo9rGEjWu3Gq3CLdXqQ6vNQTE B3uJIej0sSrTKiFzFaI4TBSKxZ3LUX4qnQpS02bzMOdIgRch7bnYeL/bzpDSfN3GKei9 mqjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=RjM4GlJucU1Ls0/IxjRJeTQsDlFI04X+oR2L/HWLcOU=; fh=3XkmkLneFu0yg4V2w06JCX4sWiHnLqFKQ3u4IGHUvPg=; b=0gS4qQDNd1lY6oZ5Ss3qV32XW0JI9gfIkl96bcfg8SklJH8oQFYGO74YtS2F3TdyvY i6dWiO4FcPZ5q1+Qfp+/CpGFKUanA40sqrH7RgI5Qtqlomlw2s7QPcCDMhC0mZGn7NrC mmmhJ6zY9hEFJZf5e4XgfVzu4lEic5HoRQ8P0nNcHwYrfUDIhi4aBJfVne3FQfWBkr0+ Jz0RyeuqFT6bJD1NBWk9D939omrTa0Q5J2yivBNE0lnm13wJldy5fvXvXYgpCV8EPB6f 7RThBo/sgzU22ptwXaLpnNIqjXa6yv+RjUsRWv26vI+pJasV3HmP0WvAF3E4+5EG/v48 bhZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm2 header.b=N3y6oVXI; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="Mra/gTVV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a4-20020a1709027d8400b001b046acc851si2742900plm.358.2023.06.25.02.55.54; Sun, 25 Jun 2023 02:56:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kroah.com header.s=fm2 header.b=N3y6oVXI; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="Mra/gTVV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231688AbjFYJeL (ORCPT + 99 others); Sun, 25 Jun 2023 05:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230029AbjFYJeI (ORCPT ); Sun, 25 Jun 2023 05:34:08 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96D53E5F for ; Sun, 25 Jun 2023 02:34:07 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 529F05C0071; Sun, 25 Jun 2023 05:34:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 25 Jun 2023 05:34:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1687685644; x=1687772044; bh=RjM4GlJucU1Ls0/IxjRJeTQsDlFI04X+oR2 L/HWLcOU=; b=N3y6oVXIfLxMNjXEj2CdDjv6SnrrazLKLzVOXwB/Zxc0FUHhpH5 9N22s/YV0SQNvbSUls1emOSWggGoX8221j9dqUrP3AWiNlk9a0MX3uFaJfLnjrBK 84OHttyK7NrtLvajk1AkWo/S9hH0tHHmNQnUAnDv53CDxnKDlI+Dm10SfAvzlJXo DNo1jG893OrYDTLzEinjV0+FFcDkbFsQjuD7j0Wap5YImVLTEkhTdsZuohGhECPm HvNVsIyVZob54JB7DWCEI/DeU45RhAy1OJDmoA31Y0l+JcAwQTTYuKDidmS0zoHo oT7wJzZORndrWKHVa/R4BJy/Bi5c/izg3Lw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1687685644; x=1687772044; bh=RjM4GlJucU1Ls0/IxjRJeTQsDlFI04X+oR2 L/HWLcOU=; b=Mra/gTVVzBBlh2KZH+VStSusrtvPlFL8EvWIJkcdSC5CM1lnwoC bj0p4+Ex1LXkZxXC+i5B1Mz32zuZmWBh2+4Vvas+7Wa3E3ea7XU44sANJP4iXSBd yMFfpcITNUe7/bdi1bpnhUxhmiczSIuZEcM4u/lDvfRFcsx2cn2w7zX+UtTipUBe C0AEJW3KMvWNuZ1OyDBGlmQlV02GZp5RlL+IETX3o8XTKkzRpaZbP24/irzAUYBB gcvesxp9ZAJnI5840uh4Suetv8aFchXCmfKTBQ4iGw94zahHJHFbzEPumzsdfV/o a3H4DKJslWajKwPQiOmiTL0zz+eH64v/vjA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeehtddgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggugfgjsehtkeertddttdejnecuhfhrohhmpefirhgv ghcumffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucggtffrrghtthgvrhhnpefgke ffieefieevkeelteejvdetvddtledugfdvhfetjeejieduledtfefffedvieenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhroh grhhdrtghomh X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 25 Jun 2023 05:34:03 -0400 (EDT) Date: Sun, 25 Jun 2023 11:34:00 +0200 From: Greg KH To: =?utf-8?B?5p2O5Z+56ZSLKHdpbmsp?= Cc: David Hildenbrand , "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "surenb@google.com" , "gregkh@google.com" , "zhangshiming@opp.com" , =?utf-8?B?6YOt5YGl?= Subject: Re: =?utf-8?B?5Zue5aSN?= =?utf-8?Q?=3A?= [PATCH] mm: vmscan: export func:shrink_slab Message-ID: <2023062554-gecko-cyclist-0c78@gregkh> References: <20230616092112.387-1-lipeifeng@oppo.com> <33eabee3-f6f4-ee0c-d74b-98815a9567c4@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 20, 2023 at 03:05:27AM +0000, 李培锋(wink) wrote: > On 16.06.23 11:21, lipeifeng@oppo.com wrote: > >> From: lipeifeng > >> > >> Some of shrinkers during shrink_slab would enter synchronous-wait due > >> to lock or other reasons, which would causes kswapd or direct_reclaim > >> to be blocked. > >> > >> This patch export shrink_slab so that it can be called in drivers > >> which can shrink memory independently. > >> > >> Signed-off-by: lipeifeng > >> --- > >> mm/vmscan.c | 3 ++- > >> 1 file changed, 2 insertions(+), 1 deletion(-) > >> > >> diff --git a/mm/vmscan.c b/mm/vmscan.c index > >> 6d0cd2840cf0..2e54fa52e7ec 100644 > >> --- a/mm/vmscan.c > >> +++ b/mm/vmscan.c > >> @@ -1043,7 +1043,7 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid, > >> * > >> * Returns the number of reclaimed slab objects. > >> */ > >> -static unsigned long shrink_slab(gfp_t gfp_mask, int nid, > >> +unsigned long shrink_slab(gfp_t gfp_mask, int nid, > >> struct mem_cgroup *memcg, > >> int priority) > >> { > >> @@ -1087,6 +1087,7 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, > >> cond_resched(); > >> return freed; > >> } > >> +EXPORT_SYMBOL_GPL(shrink_slab); > >> > >> static unsigned long drop_slab_node(int nid) > >> { > > > >It feels like something we don't want arbitrary drivers to call. > > > >Unrelated to that, this better be sent along with actual driver usage. > > Hi Sir: > > Virtually, we have implemented async shrink_slabd isolated from kswapd and direct_reclaim. > The goal above it is to avoid the sync-wait in kswapd or direct_reclaim due to some shrinkers. > > But the async shrink_slabd was only applied to mobile products so that I didn't make sure any > risk in other products. For the above reasons, I wanna merge the patch to export shrink_slab > and the patch of drivers would be considered to be pushed if I check all the risks. > > Some informal code files of driver are attached for your reference. You have to submit this as a real series, we can not accept exports for no in-kernel users (nor would you want us to, as that ends up being an unmaintainable mess.) So please resubmit this as a proper patch series, with the user of this function, and then it can be properly evaluated. As-is, this can not be accepted at all. thanks, greg k-h