Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1098283ybt; Wed, 17 Jun 2020 23:55:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcwYNARaaoFcNO0eC05rYahqJRX0X5WhM98WfgrIcNb54UQ7bHl9OixYaLW1NsvxXzSptL X-Received: by 2002:a50:aacc:: with SMTP id r12mr2660180edc.219.1592463338163; Wed, 17 Jun 2020 23:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592463338; cv=none; d=google.com; s=arc-20160816; b=Ae4YUPzq5kfjgaqJxG3k/ola7mFdfBoH62oxVslPcJ8VZk85K4weFYHsdTQFFJYSGr MtDxWF8aoE85PcYZGTi3/x9bxSbPzkWOH45jU5ieZJjWcRKvY8DQZvFVc1cjXU01rpZo m2Aqsn5iisq4jKFnePHqH8MX4GY/u70/U6fgQ4QLyhht9N8NUEx/FMvhI0g3zJSiV4Dq nI3gmSzdHwOPdmFREMOTyN5LtefODOazI4UuBLk4xwB9TyfD05yvpcaGD2eQ1bZd3ee4 TiJ8709cyjp+6ibwIuO427FqW+Jr3Auzn/RZ0Ksso9sNCs4iUZTc5w0tilf7yzv5Xxf8 D2bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6FGRqWtgXD15Eh22+O8zWbquO7KKkqTc+lfdYmXTOtc=; b=g43QVXWIt3dpaCj6ZFqgcdNyl6EMhg2tkVOH5x9IOhnZtjE0lLbp6jYtIHPLfS8Qjd E7PVFC1SQp1xmNKIJdVK377qO3Of+CL72VZLIcXygZBPbNXLU4SXI+4c8XrfO09sSc1L QsJQ395XJN6teLt0rBrhIfgWTn6cIy5HQ0aNdY+w8BO9fNNS0SbTjdR44nnh8jWtFBc0 v53QcLWNL/fVhGF7LUplJMhv+9P5USHHqHr6dng4yGBxmYoqCTxnChGr4PjoxSZWcAT4 FsAdB1I3krHegGIeUmY3Zmpe/74Xa0ReJj0fYV9cWpuIvujtBWWWebJPjwTxM9QDHe5C 489Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=aXoNO5iH; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si1316977edu.513.2020.06.17.23.55.10; Wed, 17 Jun 2020 23:55:38 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=aXoNO5iH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727842AbgFRGvN (ORCPT + 99 others); Thu, 18 Jun 2020 02:51:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726945AbgFRGvM (ORCPT ); Thu, 18 Jun 2020 02:51:12 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9312C06174E for ; Wed, 17 Jun 2020 23:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=6FGRqWtgXD15Eh22+O8zWbquO7KKkqTc+lfdYmXTOtc=; b=aXoNO5iH7w+O2Ud+POcHyxjJJv dZVED8sEXW6C6VUJA7gBX1MEh/uBmcHhgt/GsBoyIxenBaNTfVxgiXmD8I0JMVFiR0cjGUPGhNOdc 07UCtPoH4uv0BfxLpmAjblCRUfqefEVw8JgsXfoHY5AXLauaPpQv/ROZ1HydNmdKXLj6zg2TnsrAM +RZ6UlYFJADK0l99TtjGWeV0tyjS4mIn/uFcvxKM4GK1ePzIuiYvugoJc2VhUuDTwAdy1rAhNDIRQ yQiByWNU3po9QvECdfZfbajoS0a7H8uONOewkAlLkqQ4M93M90dPiHB3otgzbutzPJICHfnC/upBg ptJniOSg==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jloOC-0006Rf-0S; Thu, 18 Jun 2020 06:51:08 +0000 Date: Wed, 17 Jun 2020 23:51:07 -0700 From: Christoph Hellwig To: Peter Zijlstra Cc: Christoph Hellwig , mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, paulmck@kernel.org, frederic@kernel.org, tsbogend@alpha.franken.de, axboe@kernel.dk, rjw@rjwysocki.net, daniel.lezcano@linaro.org, dchickles@marvell.com, davem@davemloft.net, kuba@kernel.org, daniel.thompson@linaro.org, gerald.schaefer@de.ibm.com Subject: Re: [PATCH 6/6] smp: Cleanup smp_call_function*() Message-ID: <20200618065107.GA4406@infradead.org> References: <20200615125654.678940605@infradead.org> <20200615131143.434079683@infradead.org> <20200617082349.GA19894@infradead.org> <20200617110401.GG2531@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200617110401.GG2531@hirez.programming.kicks-ass.net> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 17, 2020 at 01:04:01PM +0200, Peter Zijlstra wrote: > On Wed, Jun 17, 2020 at 01:23:49AM -0700, Christoph Hellwig wrote: > > > > @@ -178,9 +178,7 @@ static void zpci_handle_fallback_irq(voi > > > if (atomic_inc_return(&cpu_data->scheduled) > 1) > > > continue; > > > > > > - cpu_data->csd.func = zpci_handle_remote_irq; > > > - cpu_data->csd.info = &cpu_data->scheduled; > > > - cpu_data->csd.flags = 0; > > > + cpu_data->csd = CSD_INIT(zpci_handle_remote_irq, &cpu_data->scheduled); > > > > This looks weird. I'd much rather see an initialization ala INIT_WORK: > > > > INIT_CSD(&cpu_data->csd, zpci_handle_remote_irq, > > &cpu_data->scheduled); > > > like so then? Much better. Although if we touch all the callers we might as well pass the csd as the argument to the callback, as with that we can pretty trivially remove the private data field later. Btw, it seems the callers that don't have the CSD embedded into the containing structure seems to be of these two kinds: - reimplementing on_each_cpumask (mostly because they can be called from irq context) - reimplenenting smp_call_function_single because they want to sleep instead of busy wait I wonder if those would be useful primitives for smp.c..