Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp949793imm; Wed, 11 Jul 2018 14:04:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf1juCAtEgzfm9rl3nsK5SwfhPe9pMrtVBb5qVSIOV3MucGC302qjb9fxN1KsItRqvMLkqW X-Received: by 2002:a65:520d:: with SMTP id o13-v6mr203210pgp.282.1531343043194; Wed, 11 Jul 2018 14:04:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531343043; cv=none; d=google.com; s=arc-20160816; b=jajmKa0/5Qf3K7ZhtjaP1/cBhP2Sl9ufEZADWDlrzKajDN56P1neobXdwhUYhj7v8x KzF1vj3yyWSZyL41urPuV89S11TXjFIMwYA6TU91XHX8NJ7J8VDQin/dxehhRTAe09Fv gExSlhiPh/3voqHAUEg80+ZFWDu7un3clu7bOf55Z3DwmAeXvsd01gfD/tK6p84dGhuX NhGla/QWerTwGxnDgBnQWLhzd9nqbwzzEXB6NzcCTm/3g+cATfqh05C6xMmtzV6g/zP+ jNDewoXMzqMOstyt2x+nnBLzh+OwxxshmLBjaCV6LELbMg8UVJ6tV6tmJlVeDmMUmHr1 ywrw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=1L/coEi2M4ibL8DT3x5j7xEIur1LEjAcFeAPprGc9yI=; b=WVxrY8gZhcbO/Tezc7x9nlbk3k6g57kxoAd20K1JwjyMkzPuUdZ3Rdgc26CzFCvOWo pdvX+0e2og7IaMwjKc8P0ewMszOkRcRW55Am4n9A4pIiqykNehZ/Hppg0I2M3WO9HtIh GT0cDby/kYV+u4iyis9ttEB8YXbuvbBQu1glCv29dxFNMRcNhtz7lnmC2hxBLgAAz0ZM GISUKKRBOoCAV/zToOHh1eWMLnV3la9zP0hjErUe7h3KcrZA2q3qH67gTQp3FczvEqd9 CQ6u0qvFCA98d676uCn0Rb9KVenqSxvlpAxIPYhL+F/yDiMeUf4RdqiNv4f6W7EaCa4U lQyA== 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 n9-v6si19369005plk.310.2018.07.11.14.03.47; Wed, 11 Jul 2018 14:04:03 -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 S2389253AbeGKPox convert rfc822-to-8bit (ORCPT + 99 others); Wed, 11 Jul 2018 11:44:53 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:40726 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732913AbeGKPox (ORCPT ); Wed, 11 Jul 2018 11:44:53 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1fdHDc-0004pQ-It; Wed, 11 Jul 2018 17:39:52 +0200 Date: Wed, 11 Jul 2018 17:39:52 +0200 From: Sebastian Andrzej Siewior To: Joe Korty Cc: Julia Cartwright , tglx@linutronix.de, rostedt@goodmis.org, 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: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20180706105857.5tgi5irdxdryet64@linutronix.de> User-Agent: NeoMutt/20180622 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Sebastian