Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2717691rwb; Fri, 20 Jan 2023 06:36:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXsuIb2h20ChTkyzpQRBDKUxWwr9goe/ts8WnSfAjhVLkck4NrU38AXZbyuFuHCd7T9Fk8Ly X-Received: by 2002:a05:6a20:144b:b0:b6:204c:709a with SMTP id a11-20020a056a20144b00b000b6204c709amr18013274pzi.36.1674225385942; Fri, 20 Jan 2023 06:36:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674225385; cv=none; d=google.com; s=arc-20160816; b=ZRSLjszAp0EwafxVKtXOR2+3MJ4BvzsYm1p1KbFjG9ZgsFg9TSiukPlBPStjy2gZXF nudgZl6ieq79Bvs1Tw3v/TaDBfrm6inTtZ1mVlCOFNHfQM8D53jWbaO9Mx//jMDWLE4c pRH/3XD7k2r9VTMio1jhH9ARlHdUNy02TyIhNW/AE6LuluE7TS4aUmhDDyKrPZJxxwpW +wRGPd+R9r3rT/WobHfHiGUORKJrMVxdz7YHTKEKzrcAxdNutbL2j/LgGN29H4FKCU8p k4jQHaNI5RhZy/cCHSh3ekpT1EJIdR+UGLkjNMwKwole/O0FsK0zkzFzlGFZXxFT3NAX yIqw== 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; bh=0l0samBDchGAV5rj0vJjDoGodYg4r0XDK7CgIdopovM=; b=PeB9m1jx2oJ9uiu7WUGmf8NaYW3uBSZmJdD+Me6UIQqCOqszTnIvOhO0IymrVTuu8x 6LnpuVyTpns414kAhn0+6Oqj/Kiqr0dYFHQ0g6Sx7GkZYeCpZl4sjznA/Cojyc1ZjayS nnTLkDD3umNL+0zybnFlgYUbND61KNgBV/wsuCj1iehQ0d0Pn4ZkkAELsPM13MRlug0f xScEWhtvwmttHieTplzNP9QcYTZa027lkEYFc+Qe2OdAJytzixd2kQzC/spXDvpDMata 2kbL9vaClSLH9CYIxV5jj1YYN59yLt7IiUVvw1kCJ1fJgE/O+bbtkDtl2Cg1UdKykAJo /S1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 38-20020a631966000000b004784f928f15si41746084pgz.91.2023.01.20.06.36.19; Fri, 20 Jan 2023 06:36:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbjATOHZ (ORCPT + 49 others); Fri, 20 Jan 2023 09:07:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjATOHW (ORCPT ); Fri, 20 Jan 2023 09:07:22 -0500 Received: from outbound-smtp23.blacknight.com (outbound-smtp23.blacknight.com [81.17.249.191]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6932435AE for ; Fri, 20 Jan 2023 06:07:19 -0800 (PST) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp23.blacknight.com (Postfix) with ESMTPS id DE4669602E for ; Fri, 20 Jan 2023 14:07:17 +0000 (GMT) Received: (qmail 17776 invoked from network); 20 Jan 2023 14:07:17 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 20 Jan 2023 14:07:17 -0000 Date: Fri, 20 Jan 2023 14:07:15 +0000 From: Mel Gorman To: Sebastian Andrzej Siewior Cc: Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Davidlohr Bueso , Linux-RT , LKML Subject: Re: [PATCH v2] locking/rwbase: Prevent indefinite writer starvation Message-ID: <20230120140715.svqidkl3fbwz3krm@techsingularity.net> References: <20230117165021.t5m7c2d6frbbfzig@techsingularity.net> <20230118173130.4n2b3cs4pxiqnqd3@techsingularity.net> <20230119110220.kphftcehehhi5l5u@techsingularity.net> <20230119174101.rddtxk5xlamlnquh@techsingularity.net> <20230120132441.4jjke47rnpikiuf5@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 20, 2023 at 02:38:27PM +0100, Sebastian Andrzej Siewior wrote: > On 2023-01-20 13:24:41 [+0000], Mel Gorman wrote: > > --- a/kernel/locking/rwbase_rt.c > > +++ b/kernel/locking/rwbase_rt.c > > @@ -264,12 +291,17 @@ static int __sched rwbase_write_lock(struct rwbase_rt *rwb, > > if (__rwbase_write_trylock(rwb)) > > break; > > > > + /* Record timeout when reader bias is ignored. */ > > + rwb->waiter_timeout = jiffies + RWBASE_RT_WAIT_TIMEOUT; > rwb->waiter_timeout = (jiffies + RWBASE_RT_WAIT_TIMEOUT) | 1; > > There is the unlikely case that (jiffies + RWBASE_RT_WAIT_TIMEOUT) = 0 > on 32bit where it is not jiffies64. > > Reviewed-by: Sebastian Andrzej Siewior > Thanks very much, updated version will be posted shortly. -- Mel Gorman SUSE Labs