Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3223839imu; Sat, 24 Nov 2018 00:29:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vjr6h5U3xSL7fLvcCVshAQKWLk7Q9SvrdcyMzzbSPzL/kM6cmkXocpLhDrgmTB9nCt7dub X-Received: by 2002:a63:5e43:: with SMTP id s64mr17188589pgb.101.1543048190577; Sat, 24 Nov 2018 00:29:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543048190; cv=none; d=google.com; s=arc-20160816; b=g5ERI0+B2pOEFwsMennVPdPiu1+Jnf0u/FYgCD4CeqawJpmRZV9dT0i80MKndqNWpj ucP0gTJ3M+gwau3MbFnZ8LfkP8hXvuKfHvvj9KfJ+3LPov5mgcKPWIdyuvtSvxSZDsjq a2oMaVEHeiV/J79tzLmGr0W3s1s0A/rkpibFy9sgpkL9XlUNhIxXyVX+HvB9hGVfgcdf TQWRNIBwzaaTA8cn0sxoJNCeuzuuac5zp/sdUj/fB39qWAEzWsdes7IT4pCVLOeLaKr6 7FWLpfrk0zfBRL+klVHbG4e/Npp5tHoY15+Cus/EaM/CCOnoF9VQENd2MQsA4wunmJdl xlrA== 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; bh=J25C9mnDo4lOeitjYZgj+8jwtvWgQT4sXNzvkNmlsWc=; b=eGUMDGk6I6gBJRtlq2KaV9aRGYGNs4luq/fkOiSuu27fvb5baP3srNVvZjaF/zouZ6 T2hrQOmIhFQTnb9PiXf8HKbEkRfEY9L6+Csh16PH6S+qSU6eW+2en+N289Rdx9AEWvap hjDGL3JpWP6LowE6/ce8yVntoVqL8RlZJ1JBM89Tc5FwiI8U2nFW6DbqTD6B3cSvocky RdbG+gZtzBnkC5iKH1dJ9lV32nqAZRlxatckk6EYEdzRl0ACBCDTTqZRx9cmkbT25Tia 2woMdcdfCBI1TrQjf4mX8TF1IoOFMwmPOrsTpIiOpWhtp1yEKhzpTr9PdautyMlWzRYB 2Vow== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si32562120pfn.212.2018.11.24.00.29.36; Sat, 24 Nov 2018 00:29:50 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409634AbeKWWP3 (ORCPT + 99 others); Fri, 23 Nov 2018 17:15:29 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:42584 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388116AbeKWWP3 (ORCPT ); Fri, 23 Nov 2018 17:15:29 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 433ED3620; Fri, 23 Nov 2018 03:31:36 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.113]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 532A33F5A0; Fri, 23 Nov 2018 03:31:34 -0800 (PST) Date: Fri, 23 Nov 2018 11:31:31 +0000 From: Catalin Marinas To: Sebastian Andrzej Siewior Cc: Andrea Parri , Peter Zijlstra , zhe.he@windriver.com, tglx@linutronix.de, rostedt@goodmis.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, boqun.feng@gmail.com Subject: Re: [PATCH v2] kmemleak: Turn kmemleak_lock to raw spinlock on RT Message-ID: <20181123113130.GA3360@arrakis.emea.arm.com> References: <1542877459-144382-1-git-send-email-zhe.he@windriver.com> <20181123095314.hervxkxtqoixovro@linutronix.de> <20181123110226.GA5125@andrea> <20181123110611.s2gmd237j7docrxt@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181123110611.s2gmd237j7docrxt@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 23, 2018 at 12:06:11PM +0100, Sebastian Andrzej Siewior wrote: > On 2018-11-23 12:02:55 [+0100], Andrea Parri wrote: > > > is this an RT-only problem? Because mainline should not allow read->read > > > locking or read->write locking for reader-writer locks. If this only > > > happens on v4.18 and not on v4.19 then something must have fixed it. > > > > Probably misunderstanding, but I'd say that read->read locking is "the > > norm"...? > > > > If you don't use qrwlock, readers are also "recursive", in part., > > > > P0 P1 > > read_lock(l) > > write_lock(l) > > read_lock(l) > > > > won't block P0 on the second read_lock(). (qrwlock somehow complicate > > the analysis; IIUC, they are recursive if and only if in_interrupt().). > > ehm, peterz, is that true? My memory on that is that all readers will > block if there is a writer pending. With qwrlocks, the readers will normally block if there is a pending writer (to avoid starving the writer), unless in_interrupt() when the readers are allowed to starve a pending writer. TLA+/PlusCal model here: ;) https://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/kernel-tla.git/tree/qrwlock.tla -- Catalin