Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp206758rdb; Sat, 27 Jan 2024 03:21:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFriQUaWGTmT3XL/KgVj3ZpMwror9vM791LWDhnQzbrCyGEPS+zWZh11w5p3yOeyzZdDRZn X-Received: by 2002:a05:6358:2829:b0:176:d5b7:344a with SMTP id k41-20020a056358282900b00176d5b7344amr530462rwb.29.1706354497438; Sat, 27 Jan 2024 03:21:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706354497; cv=pass; d=google.com; s=arc-20160816; b=PCLVRK1CSSxBpWmk1fj72mgFtP2XCW/+gZySVwypX1o1mX7KDdkCgOGLIkLfwAQcSE NWuyV+yGvoVa6DamUFqgopENvPng4hxkE9vWhMHml89MZ+9BsIJcZyhtSYWmBmMB6acK 81+rY8GaFzqhbNZDwtePyyu2vXK6gnxmqSFZnUw9PGxALgcw1+lc6aZD/RcCueU8JZZA QCvHfH0N2OxyrBKe6VwFkO3PtlIW6+xXL+bhu5Xbww9xA486Bk+gQJ6H+JNe8M0ZQNzz QBdeO1oLVqxYtus8H/WwVbgqHDp0gBVjplDzfxv/1LLgCDY0UuTxjKPzBB+YnBCeI/dB vRtQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=4wiY+3R8u6Xpi7PmT/M9j269hA0oi/65OXM4HA6JMFQ=; fh=4d3gfJQADFoOWMsp4KPr+Ui7HnWAi8QY3Ln5MlzJ5us=; b=KPmN3oVOhxSn2OvQAgZmlqvEddnpmb7h1cCXwJi6F95g6lG3vJiuGdo7j2qc7BkiIy kljJtlw+Njp2LtWfZQSI9+E5f7AcUrrNVF8CLZY2leOzRAp1Adhcw7EiBIz5k9J+7+gm lUPmz3l5770f6V4gMjWXA5D/SUixA0zln84LjhKF+6uwvCtucFQ2dOSj0BgxhIDWsJIv AYTTgZRmS94w1Dtr72bWZy/Mvdx9LNm5llwVm62gwcwh5px3qqktvaLNHNH0yuCUat0Z FrRxLsjjxgk+07u70uBMLssY0DGrQ0psduXwh500xGBqaoF2VW8VukXJwPOLW96hnK7Z CuVQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-41172-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41172-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id le14-20020a17090b150e00b0028e8c280da2si4708067pjb.29.2024.01.27.03.21.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 03:21:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41172-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-41172-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41172-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5D97DB23149 for ; Sat, 27 Jan 2024 11:21:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E1E92033E; Sat, 27 Jan 2024 11:21:07 +0000 (UTC) Received: from mail114-240.sinamail.sina.com.cn (mail114-240.sinamail.sina.com.cn [218.30.114.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7A738831 for ; Sat, 27 Jan 2024 11:20:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.114.240 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706354466; cv=none; b=kUM1agnM/XQdrgcEp8gXqKbVnlnNv0jogL7jSZJAuVbGIMBQb36eR4js3XVUGCr0JxJHCuhhSioXehTr0dpbhM5PtKIrIFSodKrhV/xzAF9r3itilxgp1Mu1LT0+V7i2fGMxMp27oDYjy9RS2qDTGKSfWaw+GxH8beE8Wnitwcs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706354466; c=relaxed/simple; bh=VWpQwLJccPYV5arsYWk3dcdPk77FtcCamRJXu4bd2DY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=H6aCyAFvKubJrej3dSnUfktuuLAWUVBnNNcaZGcMI2UmyLVzpPf0aEdvQt81HfwquWQuTrKjk8nkZk0iLhYhmLZXSCU2DpeFM3AXdC0J4PgX3ePN9rWP0ykAfbAOsfuXmhUkOyd60hjFMrB5fT+oYO6Q4B8BIOSV1jFFygPluzg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=218.30.114.240 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([113.118.69.6]) by sina.com (172.16.235.24) with ESMTP id 65B4E70D0000177C; Sat, 27 Jan 2024 19:20:48 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 91458845089280 X-SMAIL-UIID: 8F1261EC481142AA8AC7E56975D96DA0-20240127-192048-1 From: Hillf Danton To: Benjamin Segall Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] locking/percpu-rwsem: do not do lock handoff in percpu_up_write Date: Sat, 27 Jan 2024 19:20:39 +0800 Message-Id: <20240127112039.896-1-hdanton@sina.com> In-Reply-To: References: <20240123150541.1508-1-hdanton@sina.com> <20240125110456.783-1-hdanton@sina.com> <20240126122230.838-1-hdanton@sina.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Fri, 26 Jan 2024 12:40:43 -0800 Benjamin Segall > > I'm fine with "no, fairness is more important than these performance > numbers or mitigating already-sorta-broken situations", but it's not Fine too because your patch is never able to escape standing ovation. And feel free to specify the broken situations you saw. > clear to me you've even understood the patch, because you keep only > talking about completely different forms of starvation, and suggesting Given woken writer in your reply and sem->ww is write waiters, there is only one starvation in this thread. |> >> My patch makes the entire #4 available to writers (or new readers), so |> >> that the woken writer will instead get to run immediately. This is > changes that would if anything make the situation worse. I mitigate the starvation by making use of the known method without any heuristic added, though, I am happy to see why it no longer works.