Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2005021yba; Sun, 5 May 2019 20:06:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNuwKDQaaITV6835y+q9alSro+yRXf0bzq7cBcRmEe3+PbWytosKUIVJwTtfwQ8I+ugY3G X-Received: by 2002:aa7:842f:: with SMTP id q15mr30658911pfn.161.1557112013508; Sun, 05 May 2019 20:06:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557112013; cv=none; d=google.com; s=arc-20160816; b=NL/kpgLJn5qb84ZuWWCZyygFs3b0f3vo8Eq7KBICRqEjqPwqnQHEmJQJzygm9ne7p/ 82/3Z2aL2k36X29P/Sq499lPcfa9k8csumr6Uiv14LkKV1iV/K2bnc74qw/2yw2SANUk 41AW1J5wtLYD6q1PiO+/A3OUo8ZiWCHZu/qotjW4g+fklEnSuuuDh0UACArQqkBcSYIr gsxxFuxB3X3FmnuykMMYB1a+H/MIZxajzS/ttkREFEZYhnfFY56NUtNKQCks9jJuxLqX IuUj6J4IcqKNurHKGEZn9T50yfAtryMdUfgHu15IT+T+ZBPHfxBmvaClGSrITGVyzBGj CkcA== 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=S0yjtj34v0KmK0weLTL4rbIhlVJ805Al3nS3amUErXQ=; b=cQYEZ/csc7jANBt3AxML1kXrMoqkTzwYlGGPRxnwlkhT9yhtJ3wlgbBqZ47UjWykpq w9Cghd4JaxCvWHvgJA5e5Sg3bq+xWt5qglp5+2lXN39GEf4T9TGZRxsdMZqZnIx5LLC4 pSoA1NT0Qb1Fa3ZZS8YGVJCrs7aAm8CMBuFGmxm2efWk6rSkCAnQ/YpFhhaEgEwSfOwQ R4+Et7oimmUOoN7AUaHberSCx13jQSShrKcsOJPrOJUiykZlAhGc6uvHNtP/AQeYPvSE QNUOIZPLB0GqIuvffFe5QBMoP0Ek6ZyCwK+zGcUwVVV5Ohosq77DtB5K0YIhFcZYcVyJ 6dwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ih7lsyup; 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 y23si10980038pfn.287.2019.05.05.20.06.34; Sun, 05 May 2019 20:06:53 -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=ih7lsyup; 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 S1725865AbfEFDFj (ORCPT + 99 others); Sun, 5 May 2019 23:05:39 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:40953 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725827AbfEFDFj (ORCPT ); Sun, 5 May 2019 23:05:39 -0400 Received: by mail-qt1-f193.google.com with SMTP id k24so9375027qtq.7 for ; Sun, 05 May 2019 20:05:38 -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=S0yjtj34v0KmK0weLTL4rbIhlVJ805Al3nS3amUErXQ=; b=ih7lsyupSNv5hg3YmzD5rk1NfdethjHS9sb5M0UQvlIKR90WyGSWfzFFega1XhONum cqwYcNXKqGyR3gRgC/bMDDgdYFsr8Q/C2X1TQ5UR4kYLlCeoeybVlGlkX3j7CbLlbMRq DNwc7KEJdLSzf99yyQuX/OTJy1H22hLNIcpIbtDG387WrEdyeLr2osTbCMU0RJD97P9x A6jFCNedAvuM3yLO+Bv6vCZp+gyYwbeomiW6A/e7it8tg9ltgfeO81h+bYOyDzVF2yQT z9LGxw8wjZSoBHDeMAzcsXciMOTRLXpnIflhnJoGY2058PQutokc2XFYFMI1JfwItxdX FpDA== 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=S0yjtj34v0KmK0weLTL4rbIhlVJ805Al3nS3amUErXQ=; b=EHkDmZIZLuh0bo7ZT3P5qkTrboYXLxmbATj+d9qzqKs4Tco/0GDmAr7KUT4GWsX9NR GeHNWtSio7i/bLE2NLz2w8ARemK+N+z5PqJGVg31FsbvrcKlpzPTbQ1s9ZU6tVMB6ZNI eQLMEhjAnkMy2NrgO8CsGzDEr4HumQF5Lt++Jp+ns6Fbo7Gq61PEvyQqKu3NBixpZVYV NjHFbsdRskLRGDyfXC7AP+u2wWkhtBajLqX+fkT3LytLzNfDsPWgulGeW1J8t0VIf8s4 zWd/Hga+RH5xjHiHlfw7zQWPx0yBeW+03vxRhoXSDGMuOdFVUtVu6Pu8sUKfsTDd580v kMpA== X-Gm-Message-State: APjAAAVart/Ook8zzs/t8PXvy6NAmR6QHrb2QoiU1ZJsfqzUCXAXC0Ef GufCWzOZj5dO7C0K8fpkJe0E9tuUgwfLaC+fJs4= X-Received: by 2002:a0c:af81:: with SMTP id s1mr19199265qvc.49.1557111938299; Sun, 05 May 2019 20:05:38 -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: <20190430121148.GV2623@hirez.programming.kicks-ass.net> From: Yuyang Du Date: Mon, 6 May 2019 11:05:27 +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 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?