Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3047098rwo; Mon, 24 Jul 2023 05:36:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlHU3hFPajwhAHhh8h9lJsoaogzN6whoLRcCF3cwyG6YavTPYxnCoJD4sY7mo6b6eikm2lIG X-Received: by 2002:a17:90a:5518:b0:262:e439:5013 with SMTP id b24-20020a17090a551800b00262e4395013mr6589397pji.9.1690202189490; Mon, 24 Jul 2023 05:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690202189; cv=none; d=google.com; s=arc-20160816; b=duS9NBFaBJxaGRJYqNWL/pSuCVRaC6FSD1S2Vi6+TNhErHEZ7U6puVoI7wYR1GYfe9 qub13R1xN7q9FR6EJTT4eYoZZGUuf6AtvyLlyrX/+3WxRygDFf45jSZAmj7x5nQ1mb4H C+R06E70RxVV5Mty1Q3c3GnQiBIXLpdFLCr9LrZGAKTxvEcrSHGUS/jpTbbVrzPoXFZd RKRCDTQW8SjDS6RUDK4+YjxJpj/MiTE1vy+GleJ5qt1yJYGuvnqePBdHMXdhaetXI47v ahJn5TyuGchRNMTp61uaI2EEgDIHXJUrR2hbH7pFVOmiPGPzfLE2Qo6/Uyq8NUW7Lv16 o3Fw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FgtQe2iC/0NBUdTIYwU6FvaIC/2mZu3i/WpphGYT+1k=; fh=opmZ27JYvNhkzo+ncGXDjuhxMMQqJoB7IyR943Va0QA=; b=pPaLfcF9LzsflgWAehlUd7jXl9q0iXUC5+JkOFqgZct7SAkdtFvyQziZ0rcLdbh17K ehuTqb9MGB0TAhIOANQ65SLsyf1yCn9FHGJ/38rEEAMz5QPd+i/bPq1XrPIXfEAtV3pd vzXfWNyaIF/5/YRQPYqEf0Kbimge1TjbFKmT2Q4h+6lgCB0/oWrclup0r1Jbp3rPktvx 8CXLBwAQIOr9an9O1ZwPKyS/GiobTDgLd9gS5Y5vfcX5722O2+0mMvpwe6Gt3hD+i48Z QraMo7N3OdlPe3EWTEIBcBOd+yW8qyeJNQlRdAkN4vVkBrfen0uzMUPaDRQM15aO2FUZ WB7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="ZIw/NB6u"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 l10-20020a170902d04a00b001b9dc549fefsi8484911pll.135.2023.07.24.05.36.13; Mon, 24 Jul 2023 05:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@infradead.org header.s=casper.20170209 header.b="ZIw/NB6u"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbjGXM1K (ORCPT + 99 others); Mon, 24 Jul 2023 08:27:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjGXM1J (ORCPT ); Mon, 24 Jul 2023 08:27:09 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86DB419B; Mon, 24 Jul 2023 05:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=FgtQe2iC/0NBUdTIYwU6FvaIC/2mZu3i/WpphGYT+1k=; b=ZIw/NB6uEo0641+Wq8EzNrbHBV rrdS2AkdlanLUW4jtuNV7YJmE8dx65rhuqNN6d+O2A+YB9l53nFIBcRLIER24dz2SZGSbQpUdfRFt O+SQB8u46jmJ0V3lkB2dv55l0XkOFJ2vLXAjC15/xKJogcvcsepgRzVe5Zf2VfboPt9BBV/mRWBu/ r1HeDooSZKO8KrM91YanEuhJbHVgQEIeOAYvY50OE9Oa0XF31R7B/jnZvsmScHku30xY6VnjseHTr PXjdkkROSxxW+REohqgqj+xc5EAtZBuKqFbmv/xo9QoVvk4ORWEH1k1N/to1rfbfNrbjLNy69S5M/ AYY+hq7g==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qNudM-004Ned-Mr; Mon, 24 Jul 2023 12:25:53 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B0440300195; Mon, 24 Jul 2023 14:25:49 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5C178266885CD; Mon, 24 Jul 2023 14:25:49 +0200 (CEST) Date: Mon, 24 Jul 2023 14:25:49 +0200 From: Peter Zijlstra To: Qi Zheng Cc: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org, muchun.song@linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: Re: [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically allocating shrinker Message-ID: <20230724122549.GA3731903@hirez.programming.kicks-ass.net> References: <20230724094354.90817-1-zhengqi.arch@bytedance.com> <20230724094354.90817-4-zhengqi.arch@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230724094354.90817-4-zhengqi.arch@bytedance.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,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-ext4@vger.kernel.org On Mon, Jul 24, 2023 at 05:43:10PM +0800, Qi Zheng wrote: > +void shrinker_unregister(struct shrinker *shrinker) > +{ > + struct dentry *debugfs_entry; > + int debugfs_id; > + > + if (!shrinker || !(shrinker->flags & SHRINKER_REGISTERED)) > + return; > + > + down_write(&shrinker_rwsem); > + list_del(&shrinker->list); > + shrinker->flags &= ~SHRINKER_REGISTERED; > + if (shrinker->flags & SHRINKER_MEMCG_AWARE) > + unregister_memcg_shrinker(shrinker); > + debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id); > + up_write(&shrinker_rwsem); > + > + shrinker_debugfs_remove(debugfs_entry, debugfs_id); Should there not be an rcu_barrier() right about here? > + > + kfree(shrinker->nr_deferred); > + shrinker->nr_deferred = NULL; > + > + kfree(shrinker); > +} > +EXPORT_SYMBOL(shrinker_unregister);