Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3149295pxu; Tue, 8 Dec 2020 04:59:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJznkHu/DNJEdtNDvM/oYS2RfvIvysZRS6/jAVavUXilfSlnBbG/8nEkOuCJo4RQ5EKEuKqQ X-Received: by 2002:a05:6402:1841:: with SMTP id v1mr25138186edy.194.1607432354746; Tue, 08 Dec 2020 04:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607432354; cv=none; d=google.com; s=arc-20160816; b=HwaSF22htBx2Tu8bz5h3L62AE6q4qWC2oiX5c5+eMvUa5kDsAp7hN4262HmJd3LOlq YgbMwcDCZ4KR2enkzrbz1AA1L5Qc4VmVFda1QtISbvKhfI4jp0dAPk9Gl/tohTbGDlB6 ymYZZMdnHVMUApu0B2XCEc2CRNtjisv7QLd/V40DU+8DYMLGkwE42+P2EU54UPIhYd0s utftcPjvEd2iAujCW6jqusD7GeRfa/x+RKTp4mNurVZ5/VB3xOeiL/sP8vS9qq3eGNQn WfNZMDe2ltMEoJXNk5ez7gBbxYs29T8eL6V0bBDUfYFWqRbrQ0AYdM0YmJNbFMWY1Z2e Pq+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=35pjWeZIwV5ZzKGhstE73Xq/THlWfXAEgRM5OI3Jsww=; b=Cj4P9LcQ/dFgV0Dp/igtdxJIDgb6nExJxSH+qmt8x+Jb2V88c0zlqByXkf6JHbUryl UyKzfNkK/o0F0MlxiH0r8fQcDclBUSaz6iiYgBgLXiLyFcG5rESh7BDm2My5BRJ5y7Cu KSJnsiR2mAogUE1X/5LWEveTDzZqU8DFFDY6upjuQ/YJiaQHgvT6+dJeavQlhbHFhJZj Z3Xu40opuxjWsBNoZPgF7f8ffyr2yG5DJlFiQ2OYXrJpUMe2M+lvbHX7riioBK9dwIRb HwsLsnQDhH8IWjsmbycp5xjJx/K9SqXQ1/qzxJfGdEOACrV7+wKRr+IZ3JYWEr5Zknxc CESg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=O4fUd7W5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si8309277ejn.15.2020.12.08.04.58.50; Tue, 08 Dec 2020 04:59:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=O4fUd7W5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729569AbgLHMdG (ORCPT + 99 others); Tue, 8 Dec 2020 07:33:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728878AbgLHMdG (ORCPT ); Tue, 8 Dec 2020 07:33:06 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B03FC061749 for ; Tue, 8 Dec 2020 04:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=35pjWeZIwV5ZzKGhstE73Xq/THlWfXAEgRM5OI3Jsww=; b=O4fUd7W5HQS6PKP7LUsYK6PoUp OnmtIgnJzgBSdBtTt8Y1Icy5pU5FO25vPhooeKGBsBrp//bXg/1I7ye1tZAei08xB6darKbHFHLWy kO9T7ZLwEldsUoUb5i2vaN2td/uDZok0yRg2kVO7TNmByp6zMTQcHHZR9jic8uai5cIzZiO/cwfm3 ONsaStYaV3wuUaZ8J1rgVZVz4UynbQcQlzWEYtyAD8gevfY/QPOI++6TWBmi0qNkhtiSS810l6iqc 047T5j5lAD7eIhv9geTdMamBVap5a2rJjlPhU6ITuqoWLeDgixsUuTR5OSCONLjmsBQOe0HRgV2ez oal1uqKg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmcA5-0003ZT-LE; Tue, 08 Dec 2020 12:32:09 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id EB8DF304B92; Tue, 8 Dec 2020 13:32:04 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D65F0200AABB6; Tue, 8 Dec 2020 13:32:04 +0100 (CET) Date: Tue, 8 Dec 2020 13:32:04 +0100 From: Peter Zijlstra To: David Laight Cc: 'Waiman Long' , "Eric W. Biederman" , "linux-kernel@vger.kernel.org" , Linus Torvalds , Ingo Molnar , Will Deacon , Jann Horn , Vasiliy Kulikov , Al Viro , Bernd Edlinger , Oleg Nesterov , Christopher Yeoh , Cyrill Gorcunov , Sargun Dhillon , Christian Brauner , Arnd Bergmann , Arnaldo Carvalho de Melo Subject: Re: [PATCH 2/3] rwsem: Implement down_read_interruptible Message-ID: <20201208123204.GW2414@hirez.programming.kicks-ass.net> References: <87tut2bqik.fsf@x220.int.ebiederm.org> <87k0tybqfy.fsf@x220.int.ebiederm.org> <620f0908-c70a-9e54-e1b5-71d086b20756@redhat.com> <20201207090243.GE3040@hirez.programming.kicks-ass.net> <7be81903-14e3-7485-83e7-02e65e80e8c3@redhat.com> <71db845efc7d44b5a7d23b0e55b3a496@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71db845efc7d44b5a7d23b0e55b3a496@AcuMS.aculab.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 08, 2020 at 09:12:36AM +0000, David Laight wrote: > From: Waiman Long > > Sent: 07 December 2020 19:02 > ... > > > How much more difficult would it be to also add a timeout option? > > > I looked at adding one to the mutex code - and fell into a big pile > > > of replicated code. > > > > > > ISTM that one the initial locked exchange (and spin) fails a few > > > extra instructions when heading for the sleep don't really matter > > > > > Actually, I had tried that before. See > > > > https://lore.kernel.org/lkml/20190911150537.19527-1-longman@redhat.com/ > > > > That is for rwsem, but the same can be done for mutex. However, Peter > > didn't seem to like the idea of a timeout parameter. Anyway, it is > > certainly doable if there is a good use case for it. > > 'Unfortunately' my use-case if for an out-of-tree driver. > > The problem I was solving is a status call blocking because > some other code is 'stuck' (probably an oops) with a mutex held. Working around oopses is not a sane use-case. If you oops, you get to keep all the pieces.