Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1014070imu; Fri, 11 Jan 2019 13:17:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN5kV1zOy5ej3v27PQ7bshHEiIMZqnbHxFwhh3ORAjKFCyo38UkfgBjKY6SFPyxiD66VIFJj X-Received: by 2002:a17:902:42e4:: with SMTP id h91mr16509413pld.18.1547241467949; Fri, 11 Jan 2019 13:17:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547241467; cv=none; d=google.com; s=arc-20160816; b=L9Udvy2dE1Xtg0esNQSCeLdCj/JGmCm3pJ9Wgj/SQAb1003NFSbo2OWj4AGrDNPOoL BHdKIlGHBDe4WnNqt+EOMbdk8ngumAT/hct+TyMuGTgd6mOc2HMLyK0AUHfa5KJNuWZb ddNDt5pE97zQHu88xoj4iH/USOWhVFQsbV3olnKiismO3iFLKUPAqsASSBVr+VIUek+t s6xFy/c6IOhPDy/JAHlf0N9SnFS5urS79VkoFtqwcFK8L1IWz7upb10i8tsH5ar0BZm/ X2F4hpSPDh1lYDrZjlPjFUGoxgQ0H+FXyx4n06x2bxJHSBwMVcV0VqCIhk6wORBHKpDB qcjg== 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=CRYc1v5aTJcEhgMAc01myb7p/KvwuOcq0roYxtrO8c4=; b=uGvlcm7hA4K05JPODaI9VXMA9UNW8gNm5AnAILLDVj4u+iIK71UvLcmvOnlZAcf3eD YYg6/c4RsZ9EGc/8NuBGZyRsdTn6hR5iJA146P/ubOP2vFFy6Z2ytlkgkfx4mi06yAq0 ou7rwAcekeSEhzZg0PL1pID2bCwyoOGGzIWVG+YsJ3x7FCJ1/LcFia4DU5ECVMDHVIog B1bVeOD6MsHJouYA0h1tOxbWuNvXRpAb8yFTlN2EP4FRY63WTGCJJgTFZxbC/aZ8UhkT OCD0dLnuKQzDfx8YyV7sW9h42S5nj6YPFnOqMG+WW3b3PBrfex9vsne5s8Bm2OYq8Udn N40w== 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 i6si11513825pgq.207.2019.01.11.13.17.32; Fri, 11 Jan 2019 13:17:47 -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 S2390744AbfAKUXJ (ORCPT + 99 others); Fri, 11 Jan 2019 15:23:09 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:34633 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389005AbfAKUXJ (ORCPT ); Fri, 11 Jan 2019 15:23:09 -0500 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1gi3KT-0003i8-MX; Fri, 11 Jan 2019 21:22:57 +0100 Date: Fri, 11 Jan 2019 21:22:57 +0100 From: Sebastian Andrzej Siewior To: Joe Korty Cc: "julia@ni.com" , "tglx@linutronix.de" , "rostedt@goodmis.org" , "oleg@redhat.com" , "linux-rt-users@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH RT] rtmutex/rwlock: preserve state like a sleeping lock Message-ID: <20190111202257.5wcqht6nwx7y6lmy@linutronix.de> References: <20181119194619.GA32121@zipoli.concurrent-rt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181119194619.GA32121@zipoli.concurrent-rt.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The rwlock is spinning while acquiring a lock. Therefore it must become a sleeping lock on RT and preserve its task state while sleeping and waiting for the lock. Reported-by: Joe Korty Signed-off-by: Sebastian Andrzej Siewior --- kernel/locking/rwlock-rt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/locking/rwlock-rt.c b/kernel/locking/rwlock-rt.c index f2e155b2c4a8b..c3b91205161cc 100644 --- a/kernel/locking/rwlock-rt.c +++ b/kernel/locking/rwlock-rt.c @@ -128,7 +128,7 @@ void __sched __read_rt_lock(struct rt_rw_lock *lock) * That would put Reader1 behind the writer waiting on * Reader2 to call read_unlock() which might be unbound. */ - rt_mutex_init_waiter(&waiter, false); + rt_mutex_init_waiter(&waiter, true); rt_spin_lock_slowlock_locked(m, &waiter, flags); /* * The slowlock() above is guaranteed to return with the rtmutex is -- 2.20.1