Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp812719imm; Wed, 11 Jul 2018 11:22:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf3v3XSvlePIvUOqoAgktKQQxmwLIRI7r6laQw2tEA3cPxu30cQ76KkCBpLaj+Xwi690LCu X-Received: by 2002:a62:283:: with SMTP id 125-v6mr31166682pfc.51.1531333379824; Wed, 11 Jul 2018 11:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531333379; cv=none; d=google.com; s=arc-20160816; b=lBYohLwCx331EQ8YLdFt7ZSuAqrOAYgNlWZqXc7hg9U0pDvRUgHPYf/rL33UD/1mb7 OY9SvRbUl26WWMd5eM8kNFFXeOeFeGAH6TGqfHhCGK56rLdZeuvFgd8rX/RlrZvZM+7u 4AhMlVO3OUlGthKHTWjm67Wal0Gnfsdjfs3hzo16FV3lr+1SHHamsAuhCGFOWaDD/Fd9 tYrvIBzgcNcwJKnaoLu1md54DIjx0PGq5woCwsCVBQEFHfw/O1okj68AxdEcI4g4iJVO LGC+pfPEDGlUgLZTnsLNxA5OHyrkJ0/ZvzvOqJRJHDZO7QGrX0hIleHuDiPLaxv2Y8Wb hkuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=tSIqCN1UvG1PVyXMosqbZKK/E9JCsShwqR+IqyFxJ9k=; b=RlX8G3M8mffDsZdMFwLm2JPfJLm4dt3wwermijcWWI2FTsZHKNTo9zuOWnY8UfFogF eTYSrl8LKobuwRFv9mtLug68VE7TAtRZ2MgGcKvY/UO9heP3j9CWToXSE5C1IjoQYHf+ eVlyyEHP2/qBTDbOZRf/w/Le2RTUPHzKlReYJZs+L6ZFpsxy0+Zq9Pv0j60KLVpxapd5 0snbp7bbhkrcNYxtdB6Xt0TQLPb+xHaHSh0/aOlTdLu4KxOcolVFcu4iU56aiNq+vd+5 dkzl+rwOZVom4mJKCa/aUP4IOtYNtrp9EaEwM8I4OouV/XTtK3HnTzASIJWGSvoLR/Bu PhPw== 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 8-v6si19505066pgs.324.2018.07.11.11.22.31; Wed, 11 Jul 2018 11:22:59 -0700 (PDT) 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 S2389337AbeGKPss convert rfc822-to-8bit (ORCPT + 99 others); Wed, 11 Jul 2018 11:48:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:60550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbeGKPss (ORCPT ); Wed, 11 Jul 2018 11:48:48 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.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 21E1C20C03; Wed, 11 Jul 2018 15:43:52 +0000 (UTC) Date: Wed, 11 Jul 2018 11:43:50 -0400 From: Steven Rostedt To: Sebastian Andrzej Siewior Cc: Joe Korty , Julia Cartwright , tglx@linutronix.de, linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra Subject: Re: [PATCH RT v2] sched/migrate_disable: fallback to preempt_disable() instead barrier() Message-ID: <20180711114350.3e43613f@gandalf.local.home> In-Reply-To: <20180711153952.2fcniletg62hy7xf@linutronix.de> References: <20180704173519.GA24614@zipoli.concurrent-rt.com> <20180705155034.s6q2lsqc3o7srzwp@linutronix.de> <20180705161807.GA5800@zipoli.concurrent-rt.com> <20180705165937.5orx3md3krg4akaz@linutronix.de> <20180706105857.5tgi5irdxdryet64@linutronix.de> <20180711153952.2fcniletg62hy7xf@linutronix.de> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Jul 2018 17:39:52 +0200 Sebastian Andrzej Siewior wrote: > On 2018-07-06 12:58:57 [+0200], To Joe Korty wrote: > > On SMP + !RT migrate_disable() is still around. It is not part of spin_lock() > > anymore so it has almost no users. However the futex code has a workaround for > > the !in_atomic() part of migrate disable which fails because the matching > > migrade_disable() is no longer part of spin_lock(). > > > > On !SMP + !RT migrate_disable() is reduced to barrier(). This is not optimal > > because we few spots where a "preempt_disable()" statement was replaced with > > "migrate_disable()". > > > > We also used the migration_disable counter to figure out if a sleeping lock is > > acquired so RCU does not complain about schedule() during rcu_read_lock() while > > a sleeping lock is held. This changed, we no longer use it, we have now a > > sleeping_lock counter for the RCU purpose. > > > > This means we can now: > > - for SMP + RT_BASE > > full migration program, nothing changes here > > > > - for !SMP + RT_BASE > > the migration counting is no longer required. It used to ensure that the task > > is not migrated to another CPU and that this CPU remains online. !SMP ensures > > that already. > > Move it to CONFIG_SCHED_DEBUG so the counting is done for debugging purpose > > only. > > > > - for all other cases including !RT > > fallback to preempt_disable(). The only remaining users of migrate_disable() > > are those which were converted from preempt_disable() and the futex > > workaround which is already in the preempt_disable() section due to the > > spin_lock that is held. > > > > Cc: stable-rt@vger.kernel.org > > Reported-by: joe.korty@concurrent-rt.com > > Signed-off-by: Sebastian Andrzej Siewior > > --- > > v1…v2: limit migrate_disable to RT only. Use preempt_disable() for !RT > > if migrate_disable() is used. > > If there are no objections I would pick this up for next v4.16. > I still rather have migrate_disable() be a nop (barrier at most) when !RT, to keep it from being used, and just fix the places that are of issue. But we can discuss this when we push this to mainline. I'm fine with adding it to -rt if it fixes a real bug now. -- Steve