From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 474EBC43217 for ; Fri, 3 Sep 2021 04:29:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 304CE610CC for ; Fri, 3 Sep 2021 04:29:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232164AbhICEam (ORCPT ); Fri, 3 Sep 2021 00:30:42 -0400 Received: from verein.lst.de ([213.95.11.211]:53529 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232068AbhICEak (ORCPT ); Fri, 3 Sep 2021 00:30:40 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 4019668AFE; Fri, 3 Sep 2021 06:29:37 +0200 (CEST) Date: Fri, 3 Sep 2021 06:29:37 +0200 From: Christoph Hellwig To: Thomas Gleixner Cc: Linus Torvalds , "Darrick J. Wong" , Dennis Zhou , Tejun Heo , linux-fsdevel , linux-xfs , Dave Chinner , Linux Kernel Mailing List , Eric Sandeen , Christoph Hellwig Subject: Re: [GIT PULL] xfs: new code for 5.15 Message-ID: <20210903042937.GA21466@lst.de> References: <20210831211847.GC9959@magnolia> <87wnnybxkb.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wnnybxkb.ffs@tglx> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Thu, Sep 02, 2021 at 09:13:24PM +0200, Thomas Gleixner wrote: > > I'm only throwing this out as a reaction to this - I'm not sure > > another interface would be good or worthwhile, but that "enum > > cpuhp_state" is ugly enough that I thought I'd rope in Thomas for CPU > > hotplug, and the percpu memory allocation people for comments. > > It's not only about memory. > > > IOW, just _maybe_ we would want to have some kind of callback model > > for "percpu_alloc()" and it being explicitly about allocations > > becoming available or going away, rather than about CPU state. > > The per cpu storage in XFS does not go away. It contains a llist head > and the queued work items need to be moved from the dead CPU to an alive > CPU and exposed to a work queue for processing. Similar to what we do > with timers, hrtimers and other stuff. > > If there are callbacks which are doing pretty much the same thing, then > I'm all for a generic infrastructure for these. In the block layer we've added a new per-cpu bio list, for which the dead callback literally does nothing but free some memory. For that case a simple callback would be neat, but I'm not sure how common that is.