Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp714399pxb; Fri, 3 Sep 2021 11:43:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaVJQEaDvQq44/+6cvnQrZiGwtOKdNfFTRnglnsg0u4qIa6+/Hdfdxg5ToW119SNKBSbIH X-Received: by 2002:a05:6e02:1aa6:: with SMTP id l6mr272653ilv.14.1630694634704; Fri, 03 Sep 2021 11:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630694634; cv=none; d=google.com; s=arc-20160816; b=F6X72CKXW2wrk/dZ5RJWpwX5q/TaIjf3XwipnTq64T1LFeR0wsFOABv7muBm5Ip14G u2/QRcb5V5DBST4vHZ15qhnmJBB9WSX9d2h1YiiDVihjrUAWDHDNwkFk4tysrPUJ0Lzt 9Tp11Z79CpjCLLfc+Oew/f9umDU6MpluMFfKuTe6/13+iyOZQg1wekbpcbZ6pSRFdJvE fa207rYmnfuBwdjQAN7HhZAB0+NWa6YqCEI/6w56LsroyYzWtsyjFs+jIEG8VnzJJ8VP 7SPW4C2hmJJdo4Kb6cRzjTXGIUFhaZNn2HLS/y9nQwigJfWLxaPt9NBkzjNoqDHhoJKe xzTg== 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; bh=9kPuIw929oCM1hqjF6X0SykrffHZeMAV4qwiEqQpqlM=; b=LxOaFXDa7FYMEfjxoRP+JKTgYqOUyVcg0SXAKu0rMJcCbGt6/F8zbbrWW2wATurR22 LbJGBmDvoyL1h4MgxKWeyCJyG3tv9ZAhOIcfVoDm9xYTKdxf+hK3J/aXeLtq7KmDAMC4 9mbA3ZHgr1i2a2rDnvLDmT+i3sWFNhw56g+MNy9Gc1q7kSEaj9iJiauaV/GfdV9Yma15 XTf3VCZPNjMQIO3cNzA+6f0Yv4PhKHgfMkpKMQ94KGXwzvu97gvPTwMHNjLsCAO3mHLW TOXl+REk4CNJDHKJNTnOTtt5VdfgABPApSDs4isGycuRYN3TY2nxl3U2VR75nvXNVWHF nr7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si171993jae.125.2021.09.03.11.43.41; Fri, 03 Sep 2021 11:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349112AbhICSmC (ORCPT + 99 others); Fri, 3 Sep 2021 14:42:02 -0400 Received: from mail-pf1-f174.google.com ([209.85.210.174]:36678 "EHLO mail-pf1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235623AbhICSmB (ORCPT ); Fri, 3 Sep 2021 14:42:01 -0400 Received: by mail-pf1-f174.google.com with SMTP id m26so199608pff.3; Fri, 03 Sep 2021 11:41:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9kPuIw929oCM1hqjF6X0SykrffHZeMAV4qwiEqQpqlM=; b=BgjtggZTslnnwvdyD/SXLFxsloepagk62cv0/tzYi77T3haRXMH5Yagbmy0bRDBDjK MxEzKXwZOwnX7VTk4laTRXNH5uYQ7u5AWecSD6GTfON0d19Kr+EC0jka7Cy/JkK8UmRw ukzhfpfXqKp9lu7gfTiH0u0ekw4/2cVXtrSPsNT984XtDsOKhifg2eiybBZVu0ftVqqR XtHk5DhBcLRml5Cr7wPyw/PHLHi5GVNdbpRF2ZT3QsQOmqx9ZxjvX5Sd8C7UW1i1QQdK a5gbYddxEjOoV3fbYzfcF/USVCBbk6tPyr2u9jVBhChi4hOUrJL4JV8iPmd5bo8Knfrs zpAA== X-Gm-Message-State: AOAM5306MnVj6nvmB5xkirtWth+gZSXdCXOFXIROhFbLGYvl1YOO1b3h JWj3lY/C4eaQG8Qw2wi+jaWBIE5ZoeQ= X-Received: by 2002:aa7:8d46:0:b029:3cd:c2fd:fea5 with SMTP id s6-20020aa78d460000b02903cdc2fdfea5mr218631pfe.31.1630694460564; Fri, 03 Sep 2021 11:41:00 -0700 (PDT) Received: from fedora ([104.192.206.22]) by smtp.gmail.com with ESMTPSA id c26sm109821pgl.10.2021.09.03.11.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 11:40:59 -0700 (PDT) Date: Fri, 3 Sep 2021 14:40:58 -0400 From: Dennis Zhou To: Linus Torvalds Cc: "Darrick J. Wong" , Thomas Gleixner , 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: References: <20210831211847.GC9959@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Sep 02, 2021 at 08:47:42AM -0700, Linus Torvalds wrote: > On Tue, Aug 31, 2021 at 2:18 PM Darrick J. Wong wrote: > > > > As for new features: we now batch inode inactivations in percpu > > background threads, which sharply decreases frontend thread wait time > > when performing file deletions and should improve overall directory tree > > deletion times. > > So no complaints on this one, but I do have a reaction: we have a lot > of these random CPU hotplug events, and XFS now added another one. > > I don't see that as a problem, but just the _randomness_ of these > callbacks makes me go "hmm". And that "enum cpuhp_state" thing isn't > exactly a thing of beauty, and just makes me think there's something > nasty going on. > > For the new xfs usage, I really get the feeling that it's not that XFS > actually cares about the CPU states, but that this is literally tied > to just having percpu state allocated and active, and that maybe it > would be sensible to have something more specific to that kind of use. > > We have other things that are very similar in nature - like the page > allocator percpu caches etc, which for very similar reasons want cpu > dead/online notification. > > 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. > > 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. > > Comments? > I think there are 2 pieces here from percpu's side: A) Onlining and offlining state related to a percpu alloc. B) Freeing backing memory of an allocation wrt hot plug. An RFC was sent out for B) in [1] and you need A) for B). I can see percpu having a callback model for basic allocations that are independent, but for anything more complex, that subsystem would need to register with hotplug anyway. It appears percpu_counter already has hot plug support. percpu_refcount could be extended as well, but more complex initialization like the runqueues and slab related allocations would require work. In short, yes I think A) is doable/reasonable. Freeing the backing memory for A) seems trickier. We would have to figure out a clean way to handle onlining/offlining racing with new percpu allocations (adding or removing pages for the corresponding cpu's chunk). To support A), init and onlining/offlining can be separate phases, but for B) init/freeing would have to be rolled into onlining/offlining. Without freeing, it's not incorrect for_each_online_cpu() to read a dead cpu's percpu values, but with freeing it does. I guess to summarize, A) seems like it might be a good idea with init/destruction happening at allocation/freeing times. I'm a little skeptical of B) in terms of complexity. If y'all think it's a good idea I can look into it again. [1] https://lore.kernel.org/lkml/20210601065147.53735-1-bharata@linux.ibm.com/ Thanks, Dennis > > Lastly, with this release, two new features have graduated to supported > > status: inode btree counters (for faster mounts), and support for dates > > beyond Y2038. > > Oh, I had thought Y2038 was already a non-issue for xfs. Silly me. > > Linus