Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp227837lqj; Wed, 10 Apr 2024 08:47:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlGztdxxTcs0zQeix0CyF8vmXEanQviQWATjtkt7XDfinajn9RF3p63ZUqQUevUzrTcfpRKR+qOO8ec3q5P2RSYAG7DdPkT8tx8yJs9g== X-Google-Smtp-Source: AGHT+IFO164Ah0oyZoKHw0XdtDZ8IITo/527I9PYpVk2fPAi8RV0GaY8HXSq4q025Zov8TD61Mpr X-Received: by 2002:a17:906:da04:b0:a51:d239:be0c with SMTP id fi4-20020a170906da0400b00a51d239be0cmr1872814ejb.32.1712764060232; Wed, 10 Apr 2024 08:47:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712764060; cv=pass; d=google.com; s=arc-20160816; b=IyIeHn75yU/nYHhNKN5e1DTAM10P56d073V59NaGkT2V7lGcBOINyzaA8PxbqF/fHg Ydiv9J7VaaHNOutIqXDhmM+pYE16Miikuy9leyD7Zn0bsV45ls5BnCUDbXaEGXnNmnMW nB6y459LjUmfEWn3DxAE0Z6AmP8RBRyhJwa3FKJtX2+WXpD6ZInl1NI4L/59BrSgXWND vT5e4hIGzW6Ebqm4bl17+d6eMQYuaHlVR7vfvjygRmZN9atY0mfZRka7TYlwkh0ov+Xp e+p93MSwEGo8uLmL2dPIfMa+BWgw5FOTel++68oPIR7NtzYuo6Q20up0HzL+5nGva5LQ iKvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GT5kihno0CtGEg+7vZ9yWZNl3u0Nc+IwRAbIkMek22A=; fh=dpisTPJnM91kiuPrRlnafZcm4a7fOQgpPfaxLoxSx8M=; b=T5y+3hBOSrcK7zikarq7g1JRMBgAoiPPtd5PzSw97q8S2AxOx+fll70UdIyuBIexkt W0V9Mwx+7IlM+Ew2X/pp+OHzcLUMhgZF/IfVOQvGIW9Bsm+v0Dlkc9A8YkCbnEg2/IZ3 CuewCt/wb2nAXOW74ZsOa4JekmTmnIO97DSuTNeclNo+HQr+HpMg3Joohr+VyLgnQZEN tQZdjrbwzW6KEfuEoHZi5JscCbNuG9BP+TTqiOrrAz3CGtOMXcI274ZEwJPBFSqsz3+7 XahqTEyHl/8p0FZ/HmpuQF838OEkoGWlxVWQFPbg5AVjbP2cYj+59gnFmACRjfwZfOnG kviA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=l4ssNbGL; arc=pass (i=1 spf=pass spfdomain=layalina.io dkim=pass dkdomain=layalina-io.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-138910-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138910-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id xa11-20020a170907b9cb00b00a5219cab40bsi6472ejc.612.2024.04.10.08.47.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 08:47:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138910-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=l4ssNbGL; arc=pass (i=1 spf=pass spfdomain=layalina.io dkim=pass dkdomain=layalina-io.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-138910-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138910-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C266C1F2471E for ; Wed, 10 Apr 2024 15:47:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4595C16F0E1; Wed, 10 Apr 2024 15:47:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b="l4ssNbGL" Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 824551E86D for ; Wed, 10 Apr 2024 15:47:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712764052; cv=none; b=sf3+ecHVo0EryeFFsJzLm0eEkZfTHC6AYRLqNkJIm/bzI/1/v7FEV8tCR3soeQvGRNkoyoYw12TK/1ok3OLrPb3IftzkDKqy8tSx1VW/kq1nFAevIbB6cF9+fwnqM9Wp31SZ3oHWZx8JPqs3LiTfKwr/NVJMlz9srICqi/eOdFQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712764052; c=relaxed/simple; bh=dhW94+L8qu0FHYG/pT4rSi65rfiKoRlcyelRniAx4lY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hm5ziI+N1Iq7awRItO1OG89ydhDId8/+RGBjTCrip4AkWMkDr9ZZ0ilXomEf3oF5NjyK15sazWoH7HEaNoWK5eEMc6pkfaIZssFZSrhOdZ20GdXTEhzWuHQJt0JCD6hCNobxgBX3fzJ24OxaCtEQM6M5/P5lmAc6PTgiTNHxLrI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io; spf=pass smtp.mailfrom=layalina.io; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b=l4ssNbGL; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=layalina.io Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6eddff25e4eso247475b3a.3 for ; Wed, 10 Apr 2024 08:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1712764050; x=1713368850; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=GT5kihno0CtGEg+7vZ9yWZNl3u0Nc+IwRAbIkMek22A=; b=l4ssNbGLPTLTAMDnKlcNimlLx5KM3UybTHygSRMtr1prmPx5tsvJFSHaWa0zhBWGz4 Fe5aUMHPn01CJ4+f6Vhd5SGBSreZgt0KhN8HItHWtkWROeUTaJrOMS2uM3hx8j/wKbw+ OCB61ZwHbOhc+oYgyudXe5b3HvqRF5+UGzUcdU7DCMPsVfnNroTLHsuc49lMVFF3bQvj JmV5pkrmJaTDGmCjakkbej9989j8g33LVMb8tZreTTrqf4/9kv9CVSByghjOpIMiVU5R y3b36FvMXgInUOK+6r9ygeyZB7rVqBqBhLZoBJ0Rr/ryKalOzhKzoNzlmGR/cyDXok3r RbJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712764050; x=1713368850; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GT5kihno0CtGEg+7vZ9yWZNl3u0Nc+IwRAbIkMek22A=; b=c7E/c3pbQmQKssNBbZZWXiKyoaHAVpXNNshlSzxsP6kl7k2OVevGvfHu91kTOasJhl c6v4+PFt2kRPYnNQ5LJB44Y4MxYs0H3zBO+V0S0B5JpZynj7gg18ZwJPhGxMsZACW11A bPyhnnri7YgJvghKJOiy+l7mgep4J9S6+vtjCYBd8Xr2maTeDcJV+o0N7OHUPYXOJ0/G dTdH3Be1Q42oq7W5vighxlw22e0FHdaxAyP4N75Khmo7mU8bF0k3VIuT6bu8M2QZI2HJ 6VHStBkVbRy+WJdDsDAWOWTaLiuJCkV/qSwpDF8blziGOpvMwt2+g9SZ8Zh5JQaw6nPD s/hA== X-Forwarded-Encrypted: i=1; AJvYcCXRq+yWsLHdLTlIAAM8I0MLlX6XqhJBO07Uqn8h3vtn0oFH/q/jzC9/HcTr9Nbit12wl5bAZdvwd0dtPRtCuY+RH2ssOGF4bWTYdHFm X-Gm-Message-State: AOJu0Ywhj2mut/yhAMnFDXIg2/Vv0ncEepP9kEYTGHRX4gzM8mHFgan4 17Zi1iK+1RS4xY3CPNfTrgcji39evLAkYfwk+np1ldytXRSFDZezxRKTzfp3tBmWMqxOIl3DJJ0 Q0SA= X-Received: by 2002:a05:6a20:564c:b0:1a7:9adc:86e4 with SMTP id is12-20020a056a20564c00b001a79adc86e4mr3228673pzc.23.1712764049606; Wed, 10 Apr 2024 08:47:29 -0700 (PDT) Received: from airbuntu ([64.125.41.58]) by smtp.gmail.com with ESMTPSA id u12-20020aa7848c000000b006e554afa254sm10293488pfn.38.2024.04.10.08.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 08:47:29 -0700 (PDT) Date: Wed, 10 Apr 2024 16:47:27 +0100 From: Qais Yousef To: Vincent Guittot Cc: John Stultz , Ingo Molnar , Peter Zijlstra , Juri Lelli , Steven Rostedt , Daniel Bristot de Oliveira , Thomas Gleixner , "Paul E. McKenney" , Joel Fernandes , Dietmar Eggemann , linux-kernel@vger.kernel.org, Yabin Cui Subject: Re: [PATCH] sched/pi: Reweight fair_policy() tasks when inheriting prio Message-ID: <20240410154727.4yh5tcnpb6zwxuub@airbuntu> References: <20240404220500.dmfl2krll37znbi5@airbuntu> <20240405171653.boxbylrdak5fopjv@airbuntu> <20240407122700.ns7gknqwqkpjjyd4@airbuntu> <20240409061909.tb3vxc27h2eawiwg@airbuntu> <20240410065901.ruzhjsmtmpsnl4qe@airbuntu> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On 04/10/24 11:13, Vincent Guittot wrote: > > > Without cgroup, the solution could be straightforward but android uses > > > extensively cgroup AFAICT and update_cfs_group() makes impossible to > > > track the top cfs waiter and its "prio" > > > > :( > > > > IIUC the issue is that we can't easily come up with a single number of > > 'effective prio' for N level hierarchy and compare it with another M level > > hierarchy.. > > And then how do you apply it on the hierarchy ? (I am not disagreeing with you, just trying to state the reasons more explicitly) I think the application is easy, attach to the leaf cfs_rq? Which IIUC correctly what should happen with proxy execution, but by consuming the context of the donor directly without having explicitly to move the lock owner. Finding out which hierarchy actually has the highest effective share is not straightforward I agree. And if we combine a potential operation of something that could move any waiting task to a different hierarchy at anytime, this gets even more complex. I need to go and find more info, but seems Windows has some kind of boost mechanism to help the lock owner to release the lock faster. I wonder if something like that could help as interim solution. What we could do is move the task to root group as a boost with the simple reweight operation proposed here applied. As soon as it releases the lock we should restore it. From what I heard in Windows this boost happens randomly (don't quote me on this). I am not sure could be our trigger mechanism. We sure don't want to do this unconditionally otherwise we break fairness. Maybe there are easier ways to introduce a simple such boost mechanism..