Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3063088rwb; Fri, 20 Jan 2023 10:40:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXu7yCS3I5Xdif8d6hrz2IkZtdu0oXRPP4VwhrXyeM/vusL4SNjIKIhAigpivQlBOcmfmD2B X-Received: by 2002:a17:906:3399:b0:84d:335e:d136 with SMTP id v25-20020a170906339900b0084d335ed136mr15611965eja.48.1674240009260; Fri, 20 Jan 2023 10:40:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674240009; cv=none; d=google.com; s=arc-20160816; b=CSm9fWG3Hvrs/BoQLoLyMcTZefal0BO+bgAYdbLhH5yZbPRIOt8vCmZr553OxlONWR KkbxfYZjFASVF/uYfwHUZL/Fb7whJyS/ey2fbMsaeyMoallZ9wkfvJ+MHWdTE4N5/ctU CeuZFi1RIE/VW4MIjyble/Y+/YiunExg8hFYCebRfJLKaLK1SLGPWYHWkN1OOo1jvm3C r8fnoYR/e6/OkO0i6YOrN48vEpraMMsmn2D0AFitg8cz/oOsYvEj9C0gz1/6yXNVaMOd gbTRBL0IThTbvl8Snwk6gLoIuMFGo9I0wMlKQejlAP4HCmzUuFb6LKn6Z4tdZWJeAbNF HRAg== 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:dkim-signature :dkim-signature:date; bh=EPo3LVEpzVOEfXYBnBity1ZSDmfmPTYiTBNlP6gCwc4=; b=FebkYoCPSyMaKW+O44gmd2/iY9s5ComyG6wL1WG7/2eVFZdSOV9ABO5MD0666YUgX+ UwxXsSmx1b8F48CtlIvrO6P/95Y9h5aMVDdUw8XQXZGraDcfdurO3lDOnNRhLAO67IOR 2MZVwSYdG+4qGknt9sMW9XuCgDWv6dBJQNmlumLfcjECe9uDtUrhsOGu3+X9FRu5vAZa 5qbSu6pdr5CPgh8hbvF1020Q6q/fm5vPXUsB/AlY9WtAyWZbdo5VDlG2vOcNDqSMvV7F KTU+2kr+2xsaNIvpZoqCEpFZhQTkO5nUOw2FowlQpWBBlDWTHIg5hR1+69zYP5XDXtpI 9TVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WZiGoyAI; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=yUoCrzUd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc35-20020a17090716a300b0086db2a9332dsi5967078ejc.168.2023.01.20.10.39.56; Fri, 20 Jan 2023 10:40:09 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WZiGoyAI; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=yUoCrzUd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229485AbjATSeJ (ORCPT + 50 others); Fri, 20 Jan 2023 13:34:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjATSeI (ORCPT ); Fri, 20 Jan 2023 13:34:08 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D8084CE6D for ; Fri, 20 Jan 2023 10:34:07 -0800 (PST) Date: Fri, 20 Jan 2023 19:34:02 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1674239644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EPo3LVEpzVOEfXYBnBity1ZSDmfmPTYiTBNlP6gCwc4=; b=WZiGoyAIdVvdASF2zSWLpzwpOggPoPLoK9nGauUcFsTB5k8LD44Jd5OXf0WrxZr7G775Cb A87YhpH05Rr0g33n7TFKaLkMGQ7leN9TQtv5Tf6lEY26b3Vn8pwlctXSHlYyL4HajjBVsn iym8L2NC83EFOOMIWVTjaafJg/XJ8QT+TqCFgPinGwDh1LnVP9VBdDNIjTfGNM4L9e70zk A41/BzJKLgNryqpXLTs2fAAzP/gizkNlUgJ/ckLzY5sQfekZXrAkM8dc/Y5iCv7sdJrPjT KqliWNMUpFCFqhEVZjaM96oOGTL07B9GvgziVDBRFa1mDdP2g6RVDldM1hp+QA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1674239644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EPo3LVEpzVOEfXYBnBity1ZSDmfmPTYiTBNlP6gCwc4=; b=yUoCrzUdebt1eIGt/qxmKRm0Vs0plsYl5XUmgDSZ76wbWdMBLz4kD5Dw3+pa0gZ7C7uAIu 856zN+thPlWz22Aw== From: Sebastian Andrzej Siewior To: Hillf Danton Cc: Mel Gorman , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Davidlohr Bueso , linux-mm@kvack.org, LKML Subject: Re: [PATCH v2] locking/rwbase: Prevent indefinite writer starvation Message-ID: References: <20230117083817.togfwc5cy4g67e5r@techsingularity.net> <20230117165021.t5m7c2d6frbbfzig@techsingularity.net> <20230119011538.3247-1-hdanton@sina.com> <20230119135903.3524-1-hdanton@sina.com> <20230120093711.3862-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230120093711.3862-1-hdanton@sina.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 2023-01-20 17:37:11 [+0800], Hillf Danton wrote: > > I am fine with either 4ms or 40ms, or a second. > > Given the cure, does it still work when reader bias for RT tasks is allowed? No. > If not, why keep starving waiters after they pay the 40ms price? That kind of starvation will also happen if you have only spinlock_t locks and you say 3 RT tasks that acquire the lock back to back. And a few SCHED_OTHER tasks. Those 3 will be always be in front of the queue (as they skip the line) and the following SCHED_OTHER tasks will starve and never get the lock. So it is basically the same scenario. Sebastian