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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8B4DC64EC4 for ; Thu, 9 Mar 2023 09:24:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbjCIJYD (ORCPT ); Thu, 9 Mar 2023 04:24:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbjCIJYA (ORCPT ); Thu, 9 Mar 2023 04:24:00 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C398C9E303 for ; Thu, 9 Mar 2023 01:23:59 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7D3A221D61; Thu, 9 Mar 2023 09:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1678353838; h=from:from:reply-to: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; bh=tYV6covs6q4sUYe1r5Moddm6dJCRP/An10t46izMECc=; b=JSvynO75Xszjx9yhCPCK7KqJPpD/cobvo7VG5+XERG5kEy00TCqI0EmwupDQ+Oie6c1l+6 +s+WDFhJ4Iz+lsfMsUY+YNXzuVpmKkHoZGXJrMG0JCcAes1MQ9tkLqVuOAvFKsNS76Z9E5 dTgNemrjnQVm0M67NNCKNHudgwDrVOY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1678353838; h=from:from:reply-to: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; bh=tYV6covs6q4sUYe1r5Moddm6dJCRP/An10t46izMECc=; b=wV3yAiaKRytKsEooxLfqkYG/srj+yBnszPsDHbgI/QsJNWk2MFDGKRZfdB9nFRc6r/Tc75 5p6VmUchclkRBtBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3E9071391B; Thu, 9 Mar 2023 09:23:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id FiuADq6lCWRqDAAAMHmgww (envelope-from ); Thu, 09 Mar 2023 09:23:58 +0000 Message-ID: Date: Thu, 9 Mar 2023 10:23:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v4 4/8] mm: vmscan: add shrinker_srcu_generation Content-Language: en-US To: Qi Zheng , akpm@linux-foundation.org, tkhai@ya.ru, hannes@cmpxchg.org, shakeelb@google.com, mhocko@kernel.org, roman.gushchin@linux.dev, muchun.song@linux.dev, david@redhat.com, shy828301@gmail.com, rppt@kernel.org Cc: sultan@kerneltoast.com, dave@stgolabs.net, penguin-kernel@I-love.SAKURA.ne.jp, paulmck@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20230307065605.58209-1-zhengqi.arch@bytedance.com> <20230307065605.58209-5-zhengqi.arch@bytedance.com> From: Vlastimil Babka In-Reply-To: <20230307065605.58209-5-zhengqi.arch@bytedance.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/7/23 07:56, Qi Zheng wrote: > From: Kirill Tkhai > > After we make slab shrink lockless with SRCU, the longest > sleep unregister_shrinker() will be a sleep waiting for > all do_shrink_slab() calls. > > To aviod long unbreakable action in the unregister_shrinker(), ^ avoid > add shrinker_srcu_generation to restore a check similar to the > rwsem_is_contendent() check that we had before. > > And for memcg slab shrink, we unlock SRCU and continue > iterations from the next shrinker id. > > Signed-off-by: Kirill Tkhai > Signed-off-by: Qi Zheng Acked-by: Vlastimil Babka