Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3172618yba; Mon, 6 May 2019 18:48:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVms1J/ojXJYOUyHOlks2bltDvdUE0D2pyCZM+sCgcT4x2vEFGvsJ3w7NBNtd8TKXGgnOZ X-Received: by 2002:a63:2b41:: with SMTP id r62mr36626968pgr.403.1557193703500; Mon, 06 May 2019 18:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557193703; cv=none; d=google.com; s=arc-20160816; b=LQbDMxLuMvC6rgmoPAYcQu+bI/W7ae55HOjbhsU8q6eL38bCe5DYVOlKWGyeE4nTVx n8namnK+TnjbaapjF/KTio6WDVfUt64I9i4QsYrViLHoBvJuh0IEhq+TuExOQ1uDM+jd xxuh7orxcWraTFL2Kz/6knEitIosnhm7WSiP6J10B4BgSFIgP1VkGHUUhmPOLsFQdvqq 1/ZYxDWcQQtnIAojZtCD1EtIhR6z52Uoi//NBlNsRhOvMQCqVopbA+2z5dM2SDcWf4Dd dwmO0wQ6oShd/+B+6TJGvndoUxDkZjYJoDY4ZHg0X2VjV+gviG7Q3TLZK7D03cGBtvcx aebA== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=gzqxzE1jESZNJq8Z+xH5stEzJDDhgrMDjKoNZPhgsoM=; b=UoRQNPQdHHoJrKNrP6l078Rouk9a5690vRkCuorYOGqp17mfclMZK/QmarRyZO86SO dWj/rQKRpsqZLyiT1CU0Q/vAKn53F5CTx4Yy5daejLmDpQyCBmHWSXLM4ebsl85mgHR8 ODlg+2KL/ZdQ/x/P4uT16hk8NNw1MvSlS9UOxFyNk3pT8EzjFO5OmatO0dXqzA8dSb1P ReSFqeCeYNJAf68XGbHtlhDgqjm58iTK2EnqDcWvCElniETCmI0H4XhNl4xiMxFy/uxG 88EV15mxjodNCMtwTCpN6wmzzI6Jxq6QcTsBCQkqgd45xvTp0dKv6Mf185T/LDrFM01w JI5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=et2ImoZE; 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 a20si16777998pgw.465.2019.05.06.18.48.07; Mon, 06 May 2019 18:48:23 -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=@kernel.org header.s=default header.b=et2ImoZE; 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 S1726181AbfEGBrS (ORCPT + 99 others); Mon, 6 May 2019 21:47:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:56486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbfEGBrS (ORCPT ); Mon, 6 May 2019 21:47:18 -0400 Received: from localhost (lfbn-1-18355-218.w90-101.abo.wanadoo.fr [90.101.143.218]) (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 CA7B7206BF; Tue, 7 May 2019 01:47:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557193637; bh=hjGpvFskyK62aOLDo7aJ3c3Omq3LXz58x3NKbR8+/iw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=et2ImoZEQfXTtaxbVnUtcjvHubT6xOB0ocUAgj5QVCrTg4VnG6l0m1nCdNdHoLlRt wzFuzxkxBkzXsIQuaelDMIaSjl2QgDeWwAZQnAlsTxpK8UX3BTr3RVLQfDKdkbmeLR YAToDTS0U8HnGh1FQnGBa+XNTn/ep9Qg3pY5v1WE= Date: Tue, 7 May 2019 03:47:14 +0200 From: Frederic Weisbecker To: Peter Zijlstra Cc: Yuyang Du , will.deacon@arm.com, Ingo Molnar , Bart Van Assche , ming.lei@redhat.com, tglx@linutronix.de, LKML Subject: Re: [PATCH 19/28] locking/lockdep: Optimize irq usage check when marking lock usage bit Message-ID: <20190507014712.GA14921@lerouge> References: <20190424101934.51535-1-duyuyang@gmail.com> <20190424101934.51535-20-duyuyang@gmail.com> <20190425193247.GU12232@hirez.programming.kicks-ass.net> <20190430121148.GV2623@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190430121148.GV2623@hirez.programming.kicks-ass.net> 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 Tue, Apr 30, 2019 at 02:11:48PM +0200, Peter Zijlstra wrote: > On Fri, Apr 26, 2019 at 02:57:37PM +0800, Yuyang Du wrote: > > Thanks for review. > > > > On Fri, 26 Apr 2019 at 03:32, Peter Zijlstra wrote: > > > > > > On Wed, Apr 24, 2019 at 06:19:25PM +0800, Yuyang Du wrote: > > > > > > After only a quick read of these next patches; this is the one that > > > worries me most. > > > > > > You did mention Frederic's patches, but I'm not entirely sure you're > > > aware why he's doing them. He's preparing to split the softirq state > > > into one state per softirq vector. > > > > > > See here: > > > > > > https://lkml.kernel.org/r/20190228171242.32144-14-frederic@kernel.org > > > https://lkml.kernel.org/r/20190228171242.32144-15-frederic@kernel.org > > > > > > IOW he's going to massively explode this storage. > > > > If I understand correctly, he is not going to. > > > > First of all, we can divide the whole usage thing into tracking and checking. > > > > Frederic's fine-grained soft vector state is applied to usage > > tracking, i.e., which specific vectors a lock is used or enabled. > > > > But for usage checking, which vectors are does not really matter. So, > > the current size of the arrays and bitmaps are good enough. Right? > > Frederic? My understanding was that he really was going to split the > whole thing. The moment you allow masking individual soft vectors, you > get per-vector dependency chains. Right, so in my patchset there is indeed individual soft vectors masked so we indeed need per vector checks. For example a lock taken in HRTIMER softirq shouldn't be a problem if it is concurrently taken while BLOCK softirq is enabled. And for that we expand the usage_mask so that the 4 bits currently used for general SOFTIRQ are now multiplied by NR_SOFTIRQ (10) because we need to track the USED and ENABLED_IN bits for each of them. The end result is: 4 hard irq bits + 4 * 10 softirq bits + LOCK_USED bit = 45 bits. Not sure that answers the question as I'm a bit lost in the debate...