Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp334299yba; Fri, 26 Apr 2019 00:28:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjzMyrDGuZDpM8BoyJf1BHBSvHmdzwQUt8kGfOsP1Fu2GM8tKzAGnVU3U6SaIZm39oP0st X-Received: by 2002:a17:902:a513:: with SMTP id s19mr73805plq.97.1556263715249; Fri, 26 Apr 2019 00:28:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556263715; cv=none; d=google.com; s=arc-20160816; b=w7D1NC9dLttfzSLIFib/rkImOkIK1DVvvW8yJ2O7NqzRtroYs34DwFmdbRhEt1TzAK /rFQQ2AGDAj97leD97I/DEIHTYp4u2epB+Ra6yixoa1WFvGUX3S0jqxHn5sBkQLByIVg k9Yzg/bmBMf287xVvcESuN1A4/wM1sqxKZFtJTKVaZGTZiu0/IpRLKJMkyL/wCYL6JDA LMm3tYXYspXAuFDE1y4wEToxMPdbQW9YpXiT71aIJQOzV2iRHdPhfcrIjJ+vu84NuM56 lnajlIIqHjlum7xyMHT0hmAbB1+kl1aCyi7ckz4AMCq8AzmpYK+ww1VuoFkHsSplGPk/ 8xeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:user-agent:dkim-signature; bh=FzQTuDX8vAiiE9klyzh6KTDb2QcE1KMuKgtEA0Htn/A=; b=pU7TeesSLblk3VG3NwmcNHGCLHEqpMiXZ1fSUeVFxzMIfXZmB8JI0yvhJl3CKFX3bd wHzpsD5okSQGQTHacRTtdh5fYBT26xBLbNnTpmM8VuBPZ/rv59bSuvIDol9eWiwKcNs7 BQQM9uz94NSdxZfyLBxopyuQInQH0g2sZf5AJ8Ld7Pjea7h8LhhNalyB37yQwPfX8uEA f2i6rhPUnMXj0TJgZZZP5AbqZs0up6CkgVPKvGNDUEy1Yis5fFYJZvswKHLK9+g6g0Q7 ZlTD/+5WfiNuoGArRfNiCpksWb1DEhUJKncrZ+OClVFZMOhvlUU3NRAUyqxr/TCXORYz jsxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sJIH8gUf; 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 q3si22659478pgp.40.2019.04.26.00.28.20; Fri, 26 Apr 2019 00:28:35 -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=sJIH8gUf; 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 S1726005AbfDZH0E (ORCPT + 99 others); Fri, 26 Apr 2019 03:26:04 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:33192 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbfDZH0D (ORCPT ); Fri, 26 Apr 2019 03:26:03 -0400 Received: by mail-qk1-f194.google.com with SMTP id k189so1349110qkc.0 for ; Fri, 26 Apr 2019 00:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:mime-version:message-id:in-reply-to:references:date:from :to:cc:subject; bh=FzQTuDX8vAiiE9klyzh6KTDb2QcE1KMuKgtEA0Htn/A=; b=sJIH8gUfIyU2tmlQ60N5Q1pa3ykBmGa45b3jHSh2lacBj0T+RW052hH5ouFm81wu+B er3dt76xJN4P5aYI+9g0+BD1jwtHrpWwOF2xBMxdFiMfrTO1dJv+UzzDFJtdNc1sqZPM 5FA54TGhIPQ5pe/mkbK42o7jYBiq/9St/f0Hx5J51WSbqvlKeK++ViQIQoZudFS8vnD9 koaruTmihRhFSNB2t6lT2rzuW7cjrwrez6lV9xmIDoZaysL7OWgsHlPtTnBEIKSTNaPF rLt88juln/m7idW+csKlPhKc4CtUqXHLrd8jz7rxdtbNn/Sh1LmV5UZONo+bZEiMx6E8 IuXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:mime-version:message-id:in-reply-to :references:date:from:to:cc:subject; bh=FzQTuDX8vAiiE9klyzh6KTDb2QcE1KMuKgtEA0Htn/A=; b=tZDGosYaPfumWoy2wlLSxkG2jFrAmb4OgJyJl21fiZDucaogSL7t+hSb5mMWXo7JvR QvQ1UhmMa7a2QbYrmn2X8s9VU6d1KEuqOsHsgAkVqWuffqOCXt8rFToMgzB/XQlD0/nj EvxFWpRq5LxY/odjRXdc+iOChc/9jg3LQaTWGy4p4p2mGyPy1iNkd6un+MeXQzFIwMls dZm/Fpg3X32bryUbKXP6x1rTPwzACfLXrwxLwuimDR9j8fGXE4Cq/RQwKof7DxeFIMr1 vHfxwWQrj9dZpReUrwE6pEdz9tqNOzT9bXJu0UJl7BtGZTBQAcmZhvkwliAzTxgLl3iy +6vQ== X-Gm-Message-State: APjAAAWsl0zpY53NPK/7FZzOn4zOevbOLImwB4exKcQwodmzsVM77JpW LqN0xAJKAl1SR+bj5RxRgpA= X-Received: by 2002:a37:99c7:: with SMTP id b190mr34683536qke.2.1556263562518; Fri, 26 Apr 2019 00:26:02 -0700 (PDT) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id k16sm1463671qtp.28.2019.04.26.00.26.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 00:26:01 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id B87C220EB0; Fri, 26 Apr 2019 03:26:00 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute6.internal (MEProxy); Fri, 26 Apr 2019 03:26:00 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrheehgdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepfdeuohhq uhhnucfhvghnghdfuceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucffoh hmrghinhepkhgvrhhnvghlrdhorhhgnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsohhq uhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedqud ejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmhgv rdhnrghmvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id A6621D48EA; Fri, 26 Apr 2019 03:25:58 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-444-g755619f-fmstable-20190423v1 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20190424101934.51535-1-duyuyang@gmail.com> <20190424101934.51535-25-duyuyang@gmail.com> <20190425200336.GY12232@hirez.programming.kicks-ass.net> Date: Fri, 26 Apr 2019 03:25:50 -0400 From: "Boqun Feng" To: "Yuyang Du" , "Peter Zijlstra" Cc: "Will Deacon" , "Ingo Molnar" , "Bart Van Assche" , ming.lei@redhat.com, "Frederic Weisbecker" , "Thomas Gleixner" , LKML Subject: =?UTF-8?Q?Re:_[PATCH_24/28]_locking/lockdep:_Remove_!dir_in_lock_irq_usa?= =?UTF-8?Q?ge_check?= Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 26, 2019, at 3:06 PM, Yuyang Du wrote: > Thanks for review. > > On Fri, 26 Apr 2019 at 04:03, Peter Zijlstra wrote: > > > > On Wed, Apr 24, 2019 at 06:19:30PM +0800, Yuyang Du wrote: > > > In mark_lock_irq(), the following checks are performed: > > > > > > ---------------------------------- > > > | -> | unsafe | read unsafe | > > > |----------------------------------| > > > | safe | F B | F* B* | > > > |----------------------------------| > > > | read safe | F? B* | - | > > > ---------------------------------- > > > > > > Where: > > > F: check_usage_forwards > > > B: check_usage_backwards > > > *: check enabled by STRICT_READ_CHECKS > > > ?: check enabled by the !dir condition > > > > > > From checking point of view, the special F? case does not make sense, > > > whereas it perhaps is made for peroformance concern. As later patch will > > > address this issue, remove this exception, which makes the checks > > > consistent later. > > > > > > With STRICT_READ_CHECKS = 1 which is default, there is no functional > > > change. > > > > Oh man.. thinking required and it is way late.. anyway this whole read > > stuff made me remember we had a patch set on readlocks last year. > > > > https://lkml.kernel.org/r/20180411135110.9217-1-boqun.feng@gmail.com > > > > I remember reviewing that a few times and then it dropped on the floor, > > probably because Spectre crap or something sucked up all my time again :/ > > > > Sorry Boqun! > That's all right. I was also too busy to send another spin... > Oh man, I thought about the read-write lock stuff, but I didn't know > Boqun's patch. Let me hurt my brain looking at that patch. > Yuyang, a few about the status, I've changed a little on the algorithm, the latest code is at git://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git arr-rfc-wip but unfortunately, I haven't got time to rework the comments and documents, so be aware of this inconsistency. Feel free to ask me any question, and I will try to send out a fresh spin in next month. Regards, Boqun