Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp753365ybi; Fri, 31 May 2019 08:25:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwB2fvapBLZyOY2xwhMSWbt12dRLo7urU0KZDtYM1fPGiKbITcQDvdxlsiC0uyMVOxwwfGE X-Received: by 2002:a17:902:8f84:: with SMTP id z4mr10276359plo.233.1559316342907; Fri, 31 May 2019 08:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559316342; cv=none; d=google.com; s=arc-20160816; b=BF/CM8yr8Et9ys/vOinll6NK+4LboUmxgRMS0cKH1KB0iKd1n44BCf8HJ7SIalKPTN ULwUdllRm6uS93V4qMG2uTlFugTgszhpmrfMB681te2rhpEraoXlvyKk+z0l509vL4UZ Duo4ffMFtPI/WDaKDi929NKgQ2prsnbeb4v4743x+mqj+CIVOCUTnJNWnnNlke/pBXbX YTwcT2d9hChOTIFjHaCAL5RPCGnIEG33IM9uJ0VcHl6WO4FgOcKKHVzt/NdLN4j2rcuP ZF6pNyKI9tpXMPWZT/yLPkPH1DRQ9nOc87wMnoMMPvU+aDAyFKx+Jxwu1LpSPKqpKNbC 3llw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=j8Vb8qpSXm8bzNNepx05WgAIFrGuf3VkeLRTzDWN0Po=; b=K2nfz9as7LuNFDA6SLS8BKveHTFYy+6HOwXphhoyTO1P1UUbpczT2rvy/YCqAsWJqc 8C+NGCSmN+cHOwNfxUvshzHTEsd/qVFd12XyROApcp+UQfBEZgSuyMNoGWV7Ss6Dbyb2 BfKSo6d9fZd76sHK3OCXSY9kCWSK7eqe2sPb9HidC+yNVLUztIe7FnG2ZlOzgtecO5xM 9fmVdo3QmcIcPiNkIbLx6S2xYQ+8DWm4RLSZmcIOg+c6oUdRyzIrdNPK8VSyUAJyAxLi Rzelfs3MlAGDVXaqnUddUm1jBNoMJo9IRsOtlMex0WFdMVpua5tvMSMWfaHRrjA20bpP D+3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b=L7RaHhsS; 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=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q29si432647pfg.28.2019.05.31.08.25.25; Fri, 31 May 2019 08:25:42 -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; dkim=pass header.i=@digitalocean.com header.s=google header.b=L7RaHhsS; 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=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726862AbfEaPYC (ORCPT + 99 others); Fri, 31 May 2019 11:24:02 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:34170 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbfEaPYB (ORCPT ); Fri, 31 May 2019 11:24:01 -0400 Received: by mail-ot1-f65.google.com with SMTP id l17so9580902otq.1 for ; Fri, 31 May 2019 08:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digitalocean.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j8Vb8qpSXm8bzNNepx05WgAIFrGuf3VkeLRTzDWN0Po=; b=L7RaHhsSKsXosswu3wXdWufSUUg3CfskpN/TaYgjCvSi7EvOCG9A99xw2q6b9ZjdTa Xt7EJ/0lEOrBZ6TgD4elQYq3YpXCce8p9eOjo6eRZt6ML8pqgA2iLfGokwYjk04odybC EwFYNbiCbs0gVHqED/E906ddHHzY0RhbuIoXs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j8Vb8qpSXm8bzNNepx05WgAIFrGuf3VkeLRTzDWN0Po=; b=ZE3qujcO9lhZtElrtS5tenaYmpPo4NCHQjzx5d3iEPOcZE86AUSBKRlyAdRWaYotxH xdDv73xxPGHeFzukhAzbafnBhSCtqIHX2EyqUG1EDKvfbyDGvjPtoAHXbBKYFFhEoy/p W0KCn4HBSXeWe1RG4DzbLHXIHjKdzApXV/1pXKX1u0vp3m2fBjuTJJAilaBhJUVZiOO/ iUML03ipuZA7V5BlNSGkZgXdh8rHCRcVS7BfRXjgtXySBbDhUEkN9xeqkW554VvcIofX VffskJao122+JSHT7sFFoQ/r8QcQTTakNLd4guDVZVkUciPXgGYV3nO6Z7C4AOEu+FOV A8BQ== X-Gm-Message-State: APjAAAUdAuJvy497uI5scYGnt53r7GA8aT+vNw1JOvwOFDY/CDXH2zvS B+wf7p4o+SR5Tx6ogA/dAM0rmyO9eg9x/52xrKkyog== X-Received: by 2002:a9d:5788:: with SMTP id q8mr2137440oth.237.1559316240561; Fri, 31 May 2019 08:24:00 -0700 (PDT) MIME-Version: 1.0 References: <20190531110820.GP2623@hirez.programming.kicks-ass.net> In-Reply-To: <20190531110820.GP2623@hirez.programming.kicks-ass.net> From: Vineeth Pillai Date: Fri, 31 May 2019 11:23:48 -0400 Message-ID: Subject: Re: [RFC PATCH v3 10/16] sched: Core-wide rq->lock To: Peter Zijlstra Cc: Nishanth Aravamudan , Julien Desfossez , Tim Chen , Ingo Molnar , Thomas Gleixner , Paul Turner , Linus Torvalds , Linux List Kernel Mailing , Subhra Mazumdar , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , Kees Cook , Greg Kerr , Phil Auld , Aaron Lu , Aubrey Li , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > I'm confused, how doesn't this break the invariant above? > > That is, all CPUs must at all times agree on the value of rq_lockp(), > and I'm not seeing how that is true with the above changes. > While fixing the crash in cpu online/offline, I was focusing on maintaining the invariance of all online cpus to agree on the value of rq_lockp(). Would it be safe to assume that rq and rq_lock would be used only after a cpu is onlined(sched:active)?. To maintain the strict invariance, the sibling should also disable core scheduling, but we need to empty the rbtree before disabling it. I am trying to see how to empty the rbtree safely in the offline context. Thanks, Vineeth