Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp429827img; Thu, 21 Mar 2019 00:58:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqze9P34e/jXeYDsTC3IDYeGUmJ0KGgYYKXUQVI3v1G1KsE3pCAVRwwC3ScOW6SHbdjAlq9D X-Received: by 2002:a63:784e:: with SMTP id t75mr2132184pgc.326.1553155107188; Thu, 21 Mar 2019 00:58:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553155107; cv=none; d=google.com; s=arc-20160816; b=qO2l4l/mKQ/cDpeNR8TbjJwA7VGccuzEM6zIqb0xE0Saw7OURNO06a+pHvKmUpTLdK GnraR3fEn7BYNHeISrCHz7J0skP1lBOUwTXS3AsCnTaJsyIv8Ocv6khEOcMtAo20rPxT kkZRTYGa9T2NErBKKjhQCYLKTk4JuknPG3zjktMw2ijh9Y+CK5VegUuYmaJ9hdv9DicD xVVTKnAc2FVsoPQzb+cF/dXFCyWvANKX/cd+9HF6Dl/XngBDxby0izr8pYeqoilOH/9y tShNJ2DhJF+5XqQpA1W1vHxMP/d8AMUB1LaQQh+I6igZ0ep3MAUJC6NYA1P3T/YBi4GQ 5CAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=wZG81c8dEeFwy7tgsH2gf9x5SLKzJTgGuvsMIcgLUpE=; b=FQ9K+3v1ArXRbY2eKc37Bj2K4vFoNtn2Vgm2ybYpTZKcSPF1NVUxqg4+3obcxtXooq xZdsTLzt+kGMjH3lq2FUq3IOwegUhIWb9mb4aRwmE5+dbtAGLMWfwqLRq4iTZErHGKOl ioFyy+gFthxflxYwUjiAszwPBjzpasmq1FfYIKauoj2Hvhdy9oMvzrRxAcUFRdWkkO/n TdW/lsfnQe3JS5YF0K3vKhtjb0s2oXiTDp9zWV5RaytXGPLKU8kK7Lyty+nxdh5elYNJ XkrhoMWwlJRI6fWH7iakkGuh/AJSHL6DZ9mWfRCW2k9lf+FSbPfyKWGUbPomcJKb/+ai cPKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H0nuTi0p; 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 g9si3606935pgi.518.2019.03.21.00.58.11; Thu, 21 Mar 2019 00:58:27 -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=H0nuTi0p; 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 S1727883AbfCUH5e (ORCPT + 99 others); Thu, 21 Mar 2019 03:57:34 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:34774 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbfCUH5e (ORCPT ); Thu, 21 Mar 2019 03:57:34 -0400 Received: by mail-pg1-f194.google.com with SMTP id v12so3693703pgq.1 for ; Thu, 21 Mar 2019 00:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=wZG81c8dEeFwy7tgsH2gf9x5SLKzJTgGuvsMIcgLUpE=; b=H0nuTi0pwM4hCLCl+Vb+D5v+6ce+MoqF7Wlk/28pYWzie88QQSFtRuJmOeWn4kT4UN AQP/Klj4w8NU6rxZ/hYCAAUh5joiotKayth7tTSjIJrxK6jiIxxbMGa0tbJeC8QZ5SYt 32NgN+AoNU0srsZHVwhznKLiVHGJ1wlRGuNe6GFc/BirABdp0g7OpKFFw6v6we1mPSUF mQnRVNikzziOtQOq3HPlKXyf6Zu+v+fYVqbh0KuWxvqqAjf09nSzpY9MYEnIdtanVjId tT3ypmixP6YwWWMmsv/pJUL9JNUYyok0XCvikozfCL0IXeiWOAztsb9sk/zeD/tyqiQX DDlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wZG81c8dEeFwy7tgsH2gf9x5SLKzJTgGuvsMIcgLUpE=; b=FMpb2ZuxttO0bZ2GmH0jctkR2pfWxu/sjge46Vd2PTTw4KtpOFzUyQmerYuqPpQanh lAkqtjx1X+B6e3N76mEprbNPyB0PvoiaMJ3gVKs3ad/pcAcL3FpFHarYj7xp8V2sjdoM 9/JWHjpeTQzeZcSVOP2q3YHFYYLTYwdy+HhGfdvgamH+l8o4XBs1jtVKQ8ZctwK3uIw/ j2RPbqtMh6g2/b1vZd2VJXZW/hXPhVAVlsrE+VcwXzYhxhJQGdKdsNhq1DH/WC2S+DXM tjpp4FzyQ0EVZRMHJBRhia+WJc6W6cT0vCmflat78VuQYFYgsRYa9qvStKjE7jXnc47J XdjQ== X-Gm-Message-State: APjAAAX8FrHyx11RpFP0/AnEEkx1vFAqVPv5EIfXAjJFJjnuNP1vHffM lcKVdHPIfRb5pSaR6JAuG2Q= X-Received: by 2002:a17:902:d715:: with SMTP id w21mr2133083ply.14.1553155053489; Thu, 21 Mar 2019 00:57:33 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id e184sm6467148pfc.143.2019.03.21.00.57.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 00:57:32 -0700 (PDT) From: Yuyang Du To: peterz@infradead.org, will.deacon@arm.com, mingo@kernel.org Cc: bvanassche@acm.org, ming.lei@redhat.com, linux-kernel@vger.kernel.org, joe@perches.com, Yuyang Du Subject: [PATCH v3 00/18] locking/lockdep: Add comments and make some code Date: Thu, 21 Mar 2019 15:57:07 +0800 Message-Id: <20190321075725.14054-1-duyuyang@gmail.com> X-Mailer: git-send-email 2.17.2 (Apple Git-113) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, I recently looked at some system hang issues. While at it, I tried to use and understand lockdep. These patches are made as a result. I believe they should have helped me, so hopefully they do for others as well. Many thanks to Bart, Joe, and Peter for their valuable comments. Change from v2: - Removed indent adjustments only patch - Removed unnecessary if to else-if patch - Made changes according to comments - Added another doc addition patch Change from v1: - Rebased the patch series. - Added more no-functional-change patches. - Removed zapped locks in lock chains printing patch, which was a band-aid. The real problem was recently fixed by Bart. Thanks, Yuyang -- Yuyang Du (18): locking/lockdep: Change all print_*() return type to void locking/lockdep: Add description and explanation in lockdep design doc locking/lockdep: Adjust lock usage bit character checks locking/lockdep: Remove useless conditional macro locking/lockdep: Print the right depth for chain key colission locking/lockdep: Update obsolete struct field description locking/lockdep: Use lockdep_init_task for task initiation consistently locking/lockdep: Define INITIAL_CHAIN_KEY for chain keys to start with locking/lockdep: Change the range of class_idx in held_lock struct locking/lockdep: Remove unused argument in validate_chain() and check_deadlock() locking/lockdep: Update comment locking/lockdep: Remove unnecessary function pointer argument locking/lockdep: Change type of the element field in circular_queue locking/lockdep: Change the return type of __cq_dequeue() locking/lockdep: Avoid constant checks in __bfs by using offset reference locking/lockdep: Combine check_noncircular and check_redundant locking/lockdep: Update comments on dependency search locking/lockdep: Add explanation to lock usage rules in lockdep design doc Documentation/locking/lockdep-design.txt | 115 ++++++-- include/linux/lockdep.h | 30 +- init/init_task.c | 2 + kernel/fork.c | 3 - kernel/locking/lockdep.c | 487 +++++++++++++++++-------------- kernel/locking/lockdep_internals.h | 1 + 6 files changed, 378 insertions(+), 260 deletions(-) -- 1.8.3.1