Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2026938yba; Sun, 5 May 2019 20:43:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+PU4zRj67PDeTS49CcmI0BMww4LaXAI4AbYzJPoby2LCl1H84PCwP3RQJxVFDqoQxOWmo X-Received: by 2002:a62:70c6:: with SMTP id l189mr30764309pfc.139.1557114211209; Sun, 05 May 2019 20:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557114211; cv=none; d=google.com; s=arc-20160816; b=LfF5LqgUZyCiAbtsnho4HpYVqZtzXW3/kntfUCirZFjLmd+MyD/kE5/yK9IxSq6mWd 5SB8+D51wEQDpeGIwTJuuMHqBgjVdcVHdWq1x5BkJS84ePYLJlgnX0E3rlLgzdeUyY2L fg4ALlhDwEJCfzCa2/3NCTvYVrd03ORQjQ6PFVhLAXyTGwr8t8mYpUNzellG5TkfDpK8 ibZaoDcarYTn8Ja/cEG86mV6nR4RVW7VWHm4r1TM7Yv2yPSbhLBMQbWSpFops0FcLAaJ 7dY+OjCQL31xr9bLX6g+YclnVCoQWPxQdScFiBvKnFI+R21/YJ7ChpXmConSRePfluVi qypw== 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=evolvfc+v/PDNzMrluV2UQ6Ca3y538x1hstsH93Ra8w=; b=M3fsTsT2moa1KF22hXH+QkvgCiNQwnyLd4I892XcPwa59p61nfIrRipCZVQ4A7jNsq 8P9PYLrb3UM+w1xdx48+c7OxAdG58BZueU5ZxzVXp7l77kIl15TwfnPNqgNI4HmDyP+M +BPWcfzeN4MTY7w4+l/LSBv9XrNqX6R9ovB1r/FJV/DVt634vhw+BOcvZMF/Lt7Yej3A d4XHUfkR2tzHbMAag/NWnQr06flkIPlpFec/lYRWu65Fg9R3+9c3lYZzNyJmjy9i1sdI m5KQtm5aFRqxUHaFqnhDf3oLFQJbElAVeix6DDBWuh5fgANbSvlLHJgVSWmMTZboJevp Z9dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YK8OVjTB; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y29si14108027pgk.120.2019.05.05.20.43.12; Sun, 05 May 2019 20:43:31 -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=@gmail.com header.s=20161025 header.b=YK8OVjTB; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725852AbfEFDmR (ORCPT + 99 others); Sun, 5 May 2019 23:42:17 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:36030 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725813AbfEFDmR (ORCPT ); Sun, 5 May 2019 23:42:17 -0400 Received: by mail-qk1-f193.google.com with SMTP id c14so3280919qke.3 for ; Sun, 05 May 2019 20:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=evolvfc+v/PDNzMrluV2UQ6Ca3y538x1hstsH93Ra8w=; b=YK8OVjTBIW7T1GEvXYMhHWYCjfY3CgPx2TBCu4U4XnziD9WfeBWmRvw2MH656182yn v5E0ELEy7ybRGIf2LIaEXC7e1+AM0CnRv5xRiw1C471J0xEK8w1mhdkecvwfAYvxvjDY yEi6/iycQ4h9EvgcyvKoe2ixzmmhGCYpefZa5Z+PLYdasB/4vegCtIs2bXERfCL4hSay UXvHLowEBEas4JJHnZhu0G8PzVTc/fIyGDuHJ45a68VqBtnLLtlGc6xoy1ALDydOn6jo WSh7oYMiR6uJnW4+hL/thRHdHwH9vVKxcgfV2U2qQsp4JbN+vWZh7cOIaPCJ9+1SOKs2 MF1A== 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=evolvfc+v/PDNzMrluV2UQ6Ca3y538x1hstsH93Ra8w=; b=GIqfRaA6s2C4uvaTTDsfpAUb3YKH9l2M9tc3MgbT1/APwFlsUVd0n6zXxVsyajYo5t bA76pngmGGFI7wXMQiHTwcoYOAgd5C+Qjjv5L69RuKQXNcftFIXwtSI1O4kGKlZzB8ej 20aXjk1YcAJpmdMLYdXscMwxRWfez9bapZcyxGj9H0Ah5I5k/Q18NGuH1wQX1TzqYnGY CrMSG8fA5inbB9Sy7kpyohv4I84WT8/SYJUiEygIz63XIDHubQSMD1W8d/4f9NrinWLb 9Gi572hp16JubYYmUAZ2UG05dqd4eWEaNERYZRmqdxvL+ozc/C35h1WSK08YIXbWtItx G3pQ== X-Gm-Message-State: APjAAAWc5+G0NlstmFFkhe+WrXhtf3ajXu63XlX2890VlAEn0+1yMeYV ItgyHexPiSrz1/hU8PZmhR5LIHmmhqVEoK4FcwaBjg4QQ/ICJg== X-Received: by 2002:a37:404b:: with SMTP id n72mr18080998qka.98.1557114136488; Sun, 05 May 2019 20:42:16 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Yuyang Du Date: Mon, 6 May 2019 11:42:05 +0800 Message-ID: Subject: Re: [PATCH 19/28] locking/lockdep: Optimize irq usage check when marking lock usage bit To: Peter Zijlstra Cc: will.deacon@arm.com, Ingo Molnar , Bart Van Assche , ming.lei@redhat.com, Frederic Weisbecker , tglx@linutronix.de, LKML 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 On Mon, 6 May 2019 at 11:05, Yuyang Du wrote: > > On Tue, 30 Apr 2019 at 20:12, Peter Zijlstra wrote: > > > > 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. > > It seems so. What I understand is: for IRQ usage, the difference is: > > Each lock has a new usage mask: > > softirq10, ..., softirq1, hardirq > > where softirq1 | softirq2 | ... | softirq10 = softirq > > where softirq, exactly what was, virtually is used in the checking. > This is mainly because, any irq vector has any usage, the lock has > that usage, be it hard or soft. > > If that is right, hardirq can be split too (why not if softirq does > :)). So, maybe a bitmap to do them all for tracking, and optionally > maintain aggregate softirq and hardirq for checking as before. > Regardless, may irq-safe reachability thing is not affected. > > And for the chain, which is mainly for caching does not really matter > split or not (either way, the outcome will be the same?), because > there will be a hash for a chain anyway, which is the same. Right? Oh, another look at the patch, I was wrong, it can be very different if consider: used in vector X vs. enabled on vector Y (which is ok), when enablement can be so fine-grained as well, which is actually the point of the patch, though no difference for now :(