Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4032460ybl; Mon, 3 Feb 2020 11:12:47 -0800 (PST) X-Google-Smtp-Source: APXvYqw/2OH4iPmaXwD53rl9KCe6CD85pFYtIeBZBlF2jcExN9hTIurZiOE6TiQ0IhSTU++liA03 X-Received: by 2002:a05:6808:3ba:: with SMTP id n26mr409000oie.62.1580757167484; Mon, 03 Feb 2020 11:12:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580757167; cv=none; d=google.com; s=arc-20160816; b=ltpjl7ojhbdotYH/Dl02zXlgRKi+xjtOsoQ9XUou7g/cefUjMsVFwcOJ3IsLmyFsgh ljWSyW8iGSynNM6GLV/gp3XW90FhI5w098zHdjHPMiupeZawkntwhUNq3lLQ+uTCw4ju 5xrLy8DRlYX5dHV03S0nX6a94gn0rU/RNZS3jptI9BeCQyDEFaiLYf+nhHeUNSrlIU/M HHqfdwwJLFP16DmpOx3au8cb+4lRWaLlHebrRquXH29QB+rKJwvIpVRgzjyXrt2eA/5/ pCbWN7wpGETDBr16eV9v6ovcQUT9nL71ES6A3+GC/LsDzQnh1T97EwXgajJqQ8ASzgUN aSPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=mLDs/0JDBMDnDULsfEZtL9OrRcOPPEWC2b3EgCf4+tI=; b=YJXkc7bzfwj/MEQTJv8bD326biC1K2h2ITajXCJyrunw6PqE/QcfEpt/x6dHeAKoRI mSRtRjGoW38W9nBzrFTKRVhg0mUDU2gXazjQbHNvqdAgduYRxLMlzU15wfUZ5gk43Qpu x/U3rfVi5yqC1NMOscjgYt9kSl0EGCyACaKOkbI8sA5q09zQ+3rArH4etd4d9a/9O85Y uPXDG5xv+R7J0yt9Oft9WzfkppTc6ZwUg+dTax6ZJNeJAE3dWQ4v7QA3wfqbK15Sbcgp m1Qz8ROAx08vjPQXy8wqVBI0UcbivGi/srskGoUte6/7ZxZpEBnHk51ySaEanbAEOI1m WbCg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si9055604otq.112.2020.02.03.11.12.35; Mon, 03 Feb 2020 11:12:47 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728528AbgBCSIN (ORCPT + 98 others); Mon, 3 Feb 2020 13:08:13 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:60301 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726272AbgBCSIN (ORCPT ); Mon, 3 Feb 2020 13:08:13 -0500 Received: from [185.104.136.29] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iyg8n-0005sR-MD; Mon, 03 Feb 2020 19:08:09 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id AAAFD100C1B; Mon, 3 Feb 2020 19:08:03 +0100 (CET) From: Thomas Gleixner To: Matija Glavinic Pecotic , linux-kernel@vger.kernel.org Cc: "Sverdlin\, Alexander \(Nokia - DE\/Ulm\)" Subject: Re: [PATCH RESEND] cpu/hotplug: Wait for cpu_hotplug to be enabled in cpu_up/down In-Reply-To: References: Date: Mon, 03 Feb 2020 19:08:03 +0100 Message-ID: <87o8uf1r3w.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matija, Matija Glavinic Pecotic writes: > Heavier user of cpu_hotplug_enable/disable is pci_device_probe yielding > errors on bringing cpu cores up/down if pci devices are getting probed. > Situation in which pci devices are getting probed and having cpus going > down/up is valid situation. So what?. User space has to handle -EBUSY properly and it was possible even before that PCI commit that the online/offline operation request returned -EBUSY. > Problem was observed on x86 board by having partitioning of the system > to RT/NRT cpu sets failing (of which part is to bring cpus down/up via > sysfs) if pci devices would be getting probed at the same time. This is I have no idea why you need to offline/online CPUs to partition a system. There are surely more sensible ways to do that, but that's not part of this discussion. > confusing for userspace as dependency to pci devices is not clear. What's confusing about a EBUSY return code? It's pretty universaly used in situations where a facility is temporarily busy. If it's not sufficiently documented, why EBUSY can be returned and what that means, then this needs to be improved. > Fix this behavior by waiting for cpu hotplug to be ready. Return -EBUSY > only after hotplugging was not enabled for about 10 seconds. There is nothing to fix here, really. Fix the user space handling which fails to handle EBUSY. Just because this commit made it more likely that EBUSY is returned does not justify this horrid hack. Thanks, tglx