From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796243699; b=YZVl5zZ2VYyKbySP6aPCconfqSPOSca67ZCrHfrtD3MkymT4BpX6yXJLm8Cj45zhPa8f F9pv6SSKT3UDU2P+L5plnBI+3Grz1BF6l72w9YJxfx+63BUgIS74pPC9YOWWbfELFBkFn etIc9mTg4gcJZQwAgL+UTbCHjAkIh17tI8LH1TafB4F9i+PtSDSk2jgQ/V2fAzhhTBsww tpnwK49j94/xLFtqwt8F0nILr/x0TVTQaI7QCC8s9Rq4o1aIHVVbOroOo1ahN39OtC9+Y uajjxf7BxajuXjOl9jZLasVCikPdO9hwWiVnQqbiAqDdyU3rvE2Q7ywk1xNi9ZgbwGQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796243699; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=o9ALglt4b40bxzS7aeS+zsvQsrvtaEx4CjpYodY+CEQ=; b=kiypKUk6822UCyeTvQhCg9e1sy2npeu00GgIgFVker9gTfn1Is9mfoKeo4SBQbsDvIMh p3rD9QdswO3vRkpiXb/wVw7CwZPx2hqBjPuDQCRn6BREltDNzOJvLCPocYZ1OrGnhgcpz LU/n1NbOkMmCi7P6yuleR57ZGSFKFx2xsBLEXZr2zka1ln0LhiWXgN3mgPN9TGc00AhZ1 KcX8wVqu91QX+Rg13GiQBt0xvvpu7bpL4hrwJ/wWHjcJ8QDKIb+6z1Rcd4vHuyh6rCwwN nOr6zBXHLwLvhYxyuj2X3ZDZZKXfuT3uSR6DQU8bzt2oEHeHPXk5NNzZb/nJOTcgWog== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=T7MHDUmt; arc=none smtp.remote-ip=209.85.128.48 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65E7E606A32C for ; Wed, 2 Dec 2026 20:34:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 65E7E606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=T7MHDUmt Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4bb6756bb1cso9054915e9.2 for ; Wed, 02 Dec 2026 12:34:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796243698; x=1796848498; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=o9ALglt4b40bxzS7aeS+zsvQsrvtaEx4CjpYodY+CEQ=; b=T7MHDUmthl1rbhln246fV6u2fiFigbEe/aWW8F8I+wcGSJ1hwEr6pDDdWoJ8Yk9bQB eqkweICRXa6BB8V+1dzj/TXxPitU+zu3n10I808oBPVjsjX1PiAl/YoK3D4wDbmrNDMT DH9QxiZHJ9zpE+Gs2OgoYXNRoXj60Y4/etcke1yPjmV2G7VvzwVmBV8+LRGVD6WIFKQc LIYNrDUi2iLTMFljxJf6pcIcsINkI+kBKSk9QL9kDXXx5peM7NC7jFF5HHtfdqdccb9i fe38aIws/WD4WyW1bvEY3NGq3lUGYEUCCu6U/ZOrzS5AuxBCHd2ZkgKtvivES+zAmd7+ +iDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796243698; x=1796848498; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=o9ALglt4b40bxzS7aeS+zsvQsrvtaEx4CjpYodY+CEQ=; b=BE0JUCxNc5Z277w0tNf4w3dnBkZHOtDUEpg7bgnOBbdgjX+qbR+MZNiDn0OPjZEhM0 UZEFDV+hfAzBXwK0X2QFcLTlSoLvorlUkFBdYkojpQfyRhJCUVSPmOiS5mITmeOsvaIm O9LcGU75eVzXsHUiHYC/EWd3iOAUjnqWMTTEGmUVVm2T146xUWkFTzqM4lKBb7CTFgL9 O37FzK/Nl0q1u58YOX+AlPSWZnWq34bl3J1ismlEB8ckglZoex3/4fFjqunhwvjBnCZy pWKixGCgxnxp1zy2C1vKVnQ3soBwwrG5S/shB6OR8wPez+xGRRMgg35zBgKJsNZ3ZvjH YBEw== X-Forwarded-Encrypted: i=1; AL+hErF1VgPIL4ayA0p8k4t0SScYrz8HYqMNweakxzj7+6lHj2zN2Z4gcgA3wsSkopVufyCFHoTTyLC0otgLdGY=@vger.kernel.org X-Gm-Message-State: APuU4Z/VdbP20LRyUtldwxjIm5tXKsUXr/E1xgFQoW4dplh6k7dXKgFB hVZHAWYbFuXTu2JFRAM9ng1aEKwTIuzuC24wk+4OqPn8+QAqOtc/B2Bk X-Gm-Gg: AZFdTZcx5CcVQp1wHdpBeIlB+q0o07I6Qa0MOjA+STSJNXdAxQ6GhY0FwjczyMF3skN db9QAJRNfO/n9BxiVL+ED4zXtq6flN//ESp7bEHngAjjSz2KMO7TI28/ErA7c8WXamV1QDtmQOm WIR/j0BR2XAbb/wLKY+jWbX3IHzeM/NwfntgCXV4phiTAE4KQJWoR51aoVDSQKZPfPgtgqk0VOj v8XHF+g6oc1USPs7xal3dLZj2Tn5xtiw8ocCdPtfu4WeoTXiAL6re6P2npMYKlyo+AJjblftNZ8 FEU4MX8go26aOvkY2nwMdf42ifQ7wEWTTTsXDuyfYLhDyZczAxdetNic5fXgzUwqUSWNYRu/uRz qrfn3HmFqIZVfnvh8kd6mdjcYYb+KXTkYc6EsQqLs88u3+8uuKPS5dUZIxZNE5KIYFsp+dBkGnQ 5iePTpzG2mQzWIXEzwUHfcKkpD+3AshHs28ybUvBUq84C6w18iPyh8h4C8ujrmjoQKyaxOwMnbh 7r8gxFxMlrhvHm7vM0aJXxhuvtRjaqq751t6IF+l/0z53NkRnpAPcOAt706k83c21TYqM9GOTz7 BL7MNvWr4Cc7lfCDYWwxX9HI5uzW5bzuVggwkmTAoy542QIdf29BJAg= X-Received: by 2002:a5d:59c3:0:b0:491:2367:1dca with SMTP id ffacd0b85a97d-4cef750a9femr674620f8f.3.1796243696322; Wed, 02 Dec 2026 12:34:56 -0800 (PST) Received: from scheduler.schedules ([85.100.65.216]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4b33a596f9csm46383350f8f.12.2026.12.02.12.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 12:34:55 -0800 (PST) Date: Wed, 2 Dec 2026 23:34:52 +0300 From: Kayra Cizmeci To: Peng Huang Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , Juri Lelli , Vincent Guittot , Waiman Long , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , John Stultz , Suren Baghdasaryan , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sebastian Andrzej Siewior , Clark Williams , linux-rt-devel@lists.linux.dev Subject: Re: [RFC PATCH v2 0/6] rwsem: priority boost for holders blocking high-priority waiters Message-ID: References: <20261201062738.1047159-1-penghuang@google.com> <20261201211018.41673-1-penghuang@google.com> <20261202174912.648822-1-penghuang@google.com> <20261202200435.1156855-1-penghuang@google.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20261202200435.1156855-1-penghuang@google.com> On Wed, Dec 02, 2026 at 12:04:35PM -0800, Peng Huang wrote: > On Wed, Dec 02, 2026 at 10:18:20PM +0300, Kayra Cizmeci wrote: > > TB runs on TA's donation (weight) but TA doesn't pay anything > > to make the donation. Normally on Proxy Exec, TA would pay the bill. > > While here, TB does. TB is running early because TA wanted to run early, > > and TA was waiting for it. If TA didn't waited TB there is no reason for > > TB to run early. IMO, it doesn't makes sense that TA is the only one > > demanding this, and TB is the one paying the bill. > > Fair point, that's the main accounting difference from PE. > > One way to look at it: in the kernel, rwsems protect shared metadata > (mmap_lock, i_rwsem, etc.) rather than RPCs, so the work inside the > critical section is almost always TB's own work (like a background > MADV_COLD or /proc read), not work done for TA. For short holds Yeah, but the urgency of the work is coming from TA. It doesn't matter whose work it is when we are doing the work early for TA. And we are not demanding to do the work early, TA does. > (within a slice), TB runs its own critical section early and pays back > the lag when rescale_entity() restores its weight, much like rt_mutex > PI bills the holder. For longer holds, TB actually gets the higher > share during the hold and only pays back up to its residual lag on > unlock (bounded within its cgroup share under FAIR_GROUP_SCHED). > > So TB isn't really penalized unfairly; the real trade-off is the flip > side, that TA doesn't pay anything for bumping TB ahead of other > runnable tasks. If you have any ideas on how to account this back to TA > (or bound it better) without hurting down_read()/up_read(), I'd love to > hear them! Well accounting it for TA would be similar to reimplementing Proxy Exec, that is why I wanted to try to do this with Proxy Exec. I'm gonna try to sleep now. (Not a big possibility tho, I drank more coffee and tea than I should at this point) Anyways... Cheers, Kayra