From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 532FCC38141 for ; Fri, 20 Jan 2023 18:34:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229509AbjATSeK (ORCPT ); Fri, 20 Jan 2023 13:34:10 -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> 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