Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1254073ybv; Thu, 20 Feb 2020 16:28:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzKF1o1F3og1cufDJWZZcMOzXaqG3RsEkpiTd/mroBBq3yBZrCa3Nlos4Kszvs3SbY7b3Lp X-Received: by 2002:aca:33d5:: with SMTP id z204mr3920883oiz.120.1582244894196; Thu, 20 Feb 2020 16:28:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582244894; cv=none; d=google.com; s=arc-20160816; b=H67nOuAFB/x8xmDr1Qo0IipneM0oafs9OuPqxRuWP8UODtnGIT9rivD0wrTDGt1wrz QXC8iuIqG/lMB1YseKyoyJb8gpXtdPOkNNQq6a8QSA6Rng2uH0P+YFIcSHSsWdIsBEv/ 2GHlZhEru2d/8lk31aRSCxCWSTm45HRNpkVh5sK0huiJxmqzosQgKo551SUMCKzFlv+/ 6/OpVlMUJ30RgoIkchy+p5BnzQUwNVw1RiFMUXMq/1MZhMU+kTCExwG3iTEW2lWPeDtQ bKoRTZedJhv4ZynCaoHl1d5JGcCXqddRmMPI+i7YlKs0JBsYmBkdAManbl9JmjWc0Jgc diQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=pCvUR9gdehZBeirHoFjfMgttg1XLjnKqLDzeEneoKkg=; b=QUqjYKtRdKQzgphoNdl0mlXl9a6Upo9RVji10xsQF/i5teYlxRrXVz4Po4SIC9AQQU 9lb13kHIgzK7EpN+acGRG0c+elSYMw05WB+1x+u4uBgKz+Me051zSpU7jy/Evyyg9lYF yGnPn0SB509znmCFIPeZdekqUBDpKUkmxfiGkcdD0XV0e5rYAYrVlBCxaXfKizxEhOPp bZj/PJZogHc+xxnI6xqZRJg7ajYrsp9l7Y1UBK1LjtkZnCFDcYipELl7OdL93AU8Q+Cw eM+9mn9tGmw41JawKmvrnYsyGyTlgI/eAisXnwWZ8zUfjaDU1S9HDcl+CZGev2GVlxPL YXRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KeM+GMOr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id k8si581994otp.69.2020.02.20.16.28.02; Thu, 20 Feb 2020 16:28:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KeM+GMOr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729441AbgBUA0R (ORCPT + 99 others); Thu, 20 Feb 2020 19:26:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:42486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729413AbgBUA0R (ORCPT ); Thu, 20 Feb 2020 19:26:17 -0500 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63626206DB; Fri, 21 Feb 2020 00:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582244776; bh=CLYAumZ3ce877LEKU8KuyZT0P7iDSwE2QUSVz1GNFmM=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=KeM+GMOrFH0n1PDQaAaKJVEmwkr8BcF9DGfFI+EPltjB9CHzUP7QgrtOqXtKJOOMm MSVIbFT50LSv7gohTO2bWZZlV0Oan38a4+Hv3VIUjygW/j32V8ZiWPs/AJ7VkLmaI/ 1RTH8iHrL38P00ggHONkXWowfvqAD4up3nzE9/ak= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 385CC35208E2; Thu, 20 Feb 2020 16:26:16 -0800 (PST) Date: Thu, 20 Feb 2020 16:26:16 -0800 From: "Paul E. McKenney" To: Qais Yousef Cc: Thomas Gleixner , Greg Kroah-Hartman , Davidlohr Bueso , Josh Triplett , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 12/14] torture: Replace cpu_up/down with device_online/offline Message-ID: <20200221002616.GB2935@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20191125112754.25223-1-qais.yousef@arm.com> <20191125112754.25223-13-qais.yousef@arm.com> <20191127214725.GG2889@paulmck-ThinkPad-P72> <20191128165611.7lmjaszjl4gbo7u2@e107158-lin.cambridge.arm.com> <20191128170025.ii3vqbj4jpcyghut@e107158-lin.cambridge.arm.com> <20191128210246.GJ2889@paulmck-ThinkPad-P72> <20191129091344.hf5demtjytv5dw5q@e107158-lin.cambridge.arm.com> <20191129203856.GN2889@paulmck-ThinkPad-P72> <20200220153159.mzpagvbwptxlehvd@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200220153159.mzpagvbwptxlehvd@e107158-lin.cambridge.arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 20, 2020 at 03:31:59PM +0000, Qais Yousef wrote: > On 11/29/19 12:38, Paul E. McKenney wrote: > > On Fri, Nov 29, 2019 at 09:13:45AM +0000, Qais Yousef wrote: > > > On 11/28/19 13:02, Paul E. McKenney wrote: > > > > On Thu, Nov 28, 2019 at 05:00:26PM +0000, Qais Yousef wrote: > > > > > On 11/28/19 16:56, Qais Yousef wrote: > > > > > > On 11/27/19 13:47, Paul E. McKenney wrote: > > > > > > > On Mon, Nov 25, 2019 at 11:27:52AM +0000, Qais Yousef wrote: > > > > > > > > The core device API performs extra housekeeping bits that are missing > > > > > > > > from directly calling cpu_up/down. > > > > > > > > > > > > > > > > See commit a6717c01ddc2 ("powerpc/rtas: use device model APIs and > > > > > > > > serialization during LPM") for an example description of what might go > > > > > > > > wrong. > > > > > > > > > > > > > > > > This also prepares to make cpu_up/down a private interface for anything > > > > > > > > but the cpu subsystem. > > > > > > > > > > > > > > > > Signed-off-by: Qais Yousef > > > > > > > > CC: Davidlohr Bueso > > > > > > > > CC: "Paul E. McKenney" > > > > > > > > CC: Josh Triplett > > > > > > > > CC: linux-kernel@vger.kernel.org > > > > > > > > > > > > > > Looks fine from an rcutorture viewpoint, but why not provide an API > > > > > > > that pulled lock_device_hotplug() and unlock_device_hotplug() into the > > > > > > > online/offline calls? > > > > > > > > > > > > I *think* the right way to do what you say is by doing lock_device_hotplug() > > > > > > inside device_{online, offline}() - which affects all drivers not just the CPU. > > > > > > > > Or there could be a CPU-specific wrapper function that did the needed > > > > locking. (Whether this is worth it or not of course depends on the > > > > number of invocations.) > > > > > > Okay I see what you mean now. driver/base/memory.c have {add,remove}_memory() > > > that does what you say. I think we can replicate this in driver/base/cpu.c too. > > > > > > I can certainly do that, better as an improvement on top as I need to audit the > > > code to make sure the critical sections weren't relying on this lock to protect > > > something else beside the online/offline operation. > > > > Works for me! > > I'm taking that as reviewed-by, which I'll add to v3. Please shout if you still > need to have a look further. > > Once this is taken I'll add the suggested API! OK, I will bite... Why not right now? Thanx, Paul