Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp621789rdb; Mon, 29 Jan 2024 12:36:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHLRqy+ZCNanb1z+GSujFGtse1R0wEXEExuvRbvexnR52x+VlEzUy/+Sc223P3W059Qmzz2 X-Received: by 2002:a05:6358:278f:b0:178:7779:13cc with SMTP id l15-20020a056358278f00b00178777913ccmr1867803rwb.27.1706560594578; Mon, 29 Jan 2024 12:36:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706560594; cv=pass; d=google.com; s=arc-20160816; b=MH0nvlzq29qOZnIxa6FqIQK05Mp1yinYXdsAoW7c52SaCTdE3kG9AFNMxkG2j3QOEe 1WWFVomKNsJN2Z1WZ+97PfdIxm7FBjsyTxPxU9MpL8MRaIS22MlRZs2o6qkRIRig7nUg sP5oILIS2TY+EC9nXoRc+e7sCkMA0a/DB6Gjlq/P+feivjjmt9c+4MRQ4IvynrG+t8rU 3Nt5lonCkF1XQe5Zw6LNaln13JRwmEgquwrrbUaEUCefa7Jj3Aej4/d7uvlj4DkEWP8k GJFJI8gHDiEhTnHa+XOVK2LrNV0jJ0FyuQOjyYWn6zIVCnYZAoi4DN5YIxzEZ16Lsi8R KPKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=ZxWgZjR7stXfQ+YDnMHNeKFVDof3/JXTOW+q6qvfTSY=; fh=jccGqPS4WUx8nXL+z6iwdP6UvW9fZfxqCDeZ5b7nuGg=; b=mNuroXB89p6hrAjoO40HGXOwvo2hm28dfKnb8wQkbhg/ULgQYaQX7aIzek3IRIIlmL Nce3Ai9mCO6IitPTKHN8LvK60GkSpcuUhqMueWrCgTxytcyUaqyTm1bIfAT6Ul77IHph 8EEOfhB82y2gW75sNbkar9NFG0XLXBp/3IHri+PQQ2yq+gkjOagpcRmbpxW10yubgHYm cAkq5A9J0wh1QTL7yRqpBcP/3YiXqL5LE5xSSbDPyE7mz6HZEASABWdB/EUpFLtfntNq Xky7S5FnGdpBfQbF0EsN9TccodtSaxcQkaPHKPXVY9HwPIrwjg93VCRR/iBRrEmeh+6d qCKg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=dmfJNimf; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-43477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h17-20020a633851000000b005cd966560b7si6355870pgn.626.2024.01.29.12.36.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 12:36:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=dmfJNimf; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-43477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 36C3528852A for ; Mon, 29 Jan 2024 20:36:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3443C604C5; Mon, 29 Jan 2024 20:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dmfJNimf" Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4B4E2E834 for ; Mon, 29 Jan 2024 20:36:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706560587; cv=none; b=No5n4iDxQcxMCLd0YrUKb8qUrAyCn6wiRF9J5hNFUHxHjtt4YHaG8O5lMzWJdXYMDWKFVcbg3c+chPt7Jo37sfx64W79Zwk/9YISYrcxepOW6/hniS7GAWJEnsNr6TpzrFTD6dBSMCKQva1dKjDfxjUwFldutyJDDYJ7n6MagCg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706560587; c=relaxed/simple; bh=jmfLZ2+7pN7JofKmXg1xYnNEo44gbiC1PDeMaQAIhS0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=dGyiq0ogxxyz4gdRht/1xJJ5p7brf/bTuCRsWCd88TDtteZriDXSfF/zpZH0X4EkwiZzI09KsPmijaNF9vRHqroHutcJSIHo/87TZ1mZkPsO7uahtSLVWXv+VbbZWCqEQMcCad/rLOaTIxGOm28QAW3eiB6dgdfbBQBZfAvdrfs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=dmfJNimf; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1d5ce88b51cso45035ad.0 for ; Mon, 29 Jan 2024 12:36:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706560584; x=1707165384; darn=vger.kernel.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZxWgZjR7stXfQ+YDnMHNeKFVDof3/JXTOW+q6qvfTSY=; b=dmfJNimflQdk/0YNE1YOgmYHWsKEs5X1YC5JrL1Ul48bSyzT9kr6rjhxMF6mu2BOvt 8GHPdwAD2ypMh1+tyEDSvltkaL/i+6EKZ9dUtGRNlSU4sQiaDaAYEg0ll47Q/mdMMvLL sqb4UEJFaEc8xP0tp4w29aVlmqO6mx47bWOf/BydZbHFXMkFYnxa1grADwyEpyISMzTm a0jXzfZv57NuKSg1O0HyawsKC8UaTPD0MaAX5NNPrGjjqIXsYvZCcGySgPeSUfRqgesd VTtW6bl8kBemr/hAtGiJ4tIJ0DS7rdYAgf56/Pb8ooYkGsk9WdBEotk+J+0NrH1oci7T LvSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706560584; x=1707165384; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZxWgZjR7stXfQ+YDnMHNeKFVDof3/JXTOW+q6qvfTSY=; b=r9+475sCdrgQepLC9lgNErSKC82PyOc9k5DphFxGRVK0nJew1WbFLX/T2nMqOVQSpx TQtTj8t3pzf8hrQAnjSRayVGowtLnV1j1tSyYZ1Na8KutcshV0MZ1j5lhi7tvgr23WST +06aKBDZ07WLbojpLU56T6/vU6QHZ3qOUl/+4v0yOnsjeOPU8+cNydjGNQ/bA/TU0Gd9 IwNnEU7HPFneDPP5nd4F2PDBhKvuDeVv4ALfcoUEsTanSvlc4mxk27pRNSE+CZtGnUiF UjTZit25zw0CR3tn8bPE9AtiTN64/UYLBFB9LeHBXPdvQoPFWny6YLrxtYWRqWR+bUN5 QOCQ== X-Gm-Message-State: AOJu0YxZtgJWhc5IiNutKWE8GsitSY5vrUhv/Ky2X1xvdRezgpvnOEUj iXR2EexNCU/FNkiBaRO9RmAhhhhWcX5q4mUfhObKifYsb7GO7GQW9IdcBlJMs+8R7m5fWE7HRxF KGw== X-Received: by 2002:a17:902:684f:b0:1d8:b0bf:3e3f with SMTP id f15-20020a170902684f00b001d8b0bf3e3fmr46602pln.26.1706560583515; Mon, 29 Jan 2024 12:36:23 -0800 (PST) Received: from bsegall-glaptop.localhost (c-73-202-176-14.hsd1.ca.comcast.net. [73.202.176.14]) by smtp.gmail.com with ESMTPSA id f12-20020a17090274cc00b001d72358de29sm2315356plt.287.2024.01.29.12.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 12:36:21 -0800 (PST) From: Benjamin Segall To: Hillf Danton 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 In-Reply-To: <20240127112039.896-1-hdanton@sina.com> (Hillf Danton's message of "Sat, 27 Jan 2024 19:20:39 +0800") References: <20240123150541.1508-1-hdanton@sina.com> <20240125110456.783-1-hdanton@sina.com> <20240126122230.838-1-hdanton@sina.com> <20240127112039.896-1-hdanton@sina.com> Date: Mon, 29 Jan 2024 12:36:20 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Hillf Danton writes: > 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. The basic locking issue was due to userspace rapidly spawning threads (or processes) more rapidly than the cpus they are running on can support, and this causing issues for unrelated threads doing cgroup operations on other cpus. The contention can be due to a combination of just straight up spawning way too many, userspace misconfiguration of cpus allowed, or load balancer weaknesses. (If you pick minimum cpu.shares values and have large machines, SCHED_LOAD_RESOLUTION isn't really enough for load balance to do a good job, and what you're telling the load balancer you want isn't really a good idea in the first place). > >> 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. The problem is *not* new readers/writers coming in and taking the lock before the waiting ones, which is what your patch would solve. The problem is that some of the woken readers do not get scheduled for a long time, and nothing can take the lock until they do.