Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2333371lqb; Mon, 27 May 2024 16:45:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6YubePyCbT0qNvN+H8ZbL/B1h1UUR7Gqqr3iXjLkhGa4j9QqPKGnOCa3A9T0rfpQ3RZbntaKfyJLhKP2ioi9cpdwwAx1pBp5ueYkkYA== X-Google-Smtp-Source: AGHT+IHG7eLJVNyLnbng31Q0f8WCLJAvfMHpSDotDqy1hgnl1yS+9q5iCUILGLyk8vtlSPvAqQ5V X-Received: by 2002:ac8:5d47:0:b0:43d:f527:a755 with SMTP id d75a77b69052e-43fafafff80mr197439221cf.13.1716853546916; Mon, 27 May 2024 16:45:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716853546; cv=pass; d=google.com; s=arc-20160816; b=L5geGoWP1ZkZmcP6dI4/n2phIWtP5KR5p8QwQPTPl9vqRmazyC7MKryTocd0TBuiqG vyZajWqpUh8MzEs+sROr4e9UZ5XY5/6hcp9B550KdAJP/pJbyUViV7mD3QqbNLdYikmt q685UMwd9qLDwqIJR5Vk+ZkzNBtAtJ1720m3xSQmffdu1Yw8adOngBJfiLw8ZAVGv4OZ Ur2umG8F1Gn75FXSJ1vQyKztolOwRJz/jVQmvtFQCGKdWKxB5MGV1W4JgqFkoWRr8fws 0G+q/hmepUHW2J9EL7mupL70BcKKThbSmeTJdqQE0aNGOsS3ogpFslz09HI/z0ifhzeZ 2M5A== 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:dkim-signature; bh=LabiRKd6+Fdc1S9teFQ4XXd5rRTCMDgsFOfIBlpIeJQ=; fh=hMrS93DLPhX6bA45dDEOv6b9B6PL/NToxr1ojTKEjiA=; b=qWpB2XWV0yicKtXQJJYvxeHEsh9tqPYbrPPOW+wq6olPtQfW9I2fDBa3QHfwRn3cPB dDLbkTLK//E4GmCiWpKaAWfpBsijIlGejRiGzws0y0D36klOXol6NnAvfKkaq7TKXgo8 JSJRLTAa/ymeISbe/T4J5O2rJaERd3ox2qYI43kfPcP6ImkZWV7ySlvhfSfb5GcaIlhA DdQ3PgeZCf+YLqI+by3djNfZrBXHqJK4V/UNX1fQYd2evMX0iksgMVYkq95B8WBDTkDd wQKPE09CJOAHrIaPCoMnDLjLH/BYliJ5ptwr1hY/kqqeSpI0+LVEcCSN4RNWlD2XngIh tr2g==; 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=zv3Fm8NW; 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-191519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191519-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18a613asi96509031cf.375.2024.05.27.16.45.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 16:45:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=zv3Fm8NW; 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-191519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191519-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A11281C21431 for ; Mon, 27 May 2024 23:45:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AAFF913C9CA; Mon, 27 May 2024 23:45:24 +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="zv3Fm8NW" Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 3798F13C3D5 for ; Mon, 27 May 2024 23:45:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716853523; cv=none; b=XkK6lIY7Anh7PQVA+OwBirUbbk0M30lAGqD7r4OHkPfIbpUE2iIaze3Pf7oMStqyPToPDTZqaLfBVfdeaDcVFsDNsDW/55CXpYlw0SjwAahnl7KaRtv1R87c6QVbFzILT+0RqWqSeo5f4Szu+XSxuPMR/lf1Lzq/8qckJftx6T8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716853523; c=relaxed/simple; bh=DukxrWCXAjyyH7zpUw9lAqh0pCE9UlNjO3BaKcx0yMU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=r9SkmlfHJC0Num/Hibd+H4NP6L0SAeNmlL60BlggtKtXODJHRpGaWZbFuxEEpYvtLxRYw6OlbGXQaqVdbL5/Zlw42vYuM281hNBPFC2iOz748b6+sNyNWVkiAbPdKxjRYFDPima8YwkD30WvK7/77d4GArMmNMiwldYixs/Eq88= 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=zv3Fm8NW; arc=none smtp.client-ip=209.85.221.45 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-wr1-f45.google.com with SMTP id ffacd0b85a97d-354b7d76c52so189882f8f.3 for ; Mon, 27 May 2024 16:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1716853520; x=1717458320; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LabiRKd6+Fdc1S9teFQ4XXd5rRTCMDgsFOfIBlpIeJQ=; b=zv3Fm8NWfLrh94W5mbCakfMstwMO4wu8AdTeDfEvLpZSjKRj/4qeCIwudlWxcYS8ol p/Eb3wAeirABuNhlt5fJ69Pbrl6sTz4RECNH6BHdBgfxzo1Oz7afBzHmRWPChALa+v6n gIHFNppSN7onGqSKdvk00hjjUaltzuTdP5Oqmy7Lf0gaZ/fjX/oc8+6LY445PtIwURfp vVhZ1EoHqaVsXZRy3MdTpqE6o4Rf/CSPIPS93M4nXMU+0lBVSz63EvB9IDGG4SJOGrK3 eKuNQaKYD6iobPN6WcIeIIJ+w552eGfxrJEh2VCugtOCUIddCiifv/EXBboMlW75GA9C kQkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716853520; x=1717458320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LabiRKd6+Fdc1S9teFQ4XXd5rRTCMDgsFOfIBlpIeJQ=; b=PzN4QEFAQcIxugUjneiL5z9jHD/uWhab438mWuJgWAwGGmSCA1qOfAJq31WMO/hfJx 2McSwSMd8crv3Ghqxbzt2bY5PM3ozm6Fpqifh/fhLkLRSoKkw3w1tdIKU8SXLqqtv864 /mc2NUCzO0+c90U2CjMFuJiAI8w3SkwYblL5/OhGyjSwW++0X3nCz9/uyQ3/Wnp+66so Avm1QpYSrmrsWBtdjd13gka8JZsIpWhhiN2L2oCnJ1rT6OJejxURLXnu2BD+ozL1MIv6 cHHi3g33Nlsw0AHGYp1JhjRGck9HI4Kar0WM5mxeP/fWOqZw/szq6WvUoULpI1r9H7Hl Mr4A== X-Forwarded-Encrypted: i=1; AJvYcCX0qAVCApk2KeeX2QczJx+5mHFKcsvvGBeht91SDnvdakG0LJjorlg8WA1ftWRb3v2P6UKZsKUlu8Vmz9oFgZMiXXLp/ifXSk/8wu9c X-Gm-Message-State: AOJu0YxZe+jYGsArU86/Tixru+UZZx98mY/gVOTliUuu2inW77uv45hh cjWo+DXy++aGgMq42A0p8euEGDRe4qHUkRHm+7M/J1lCyyan3r1gLx7DTSbH61Q= X-Received: by 2002:a05:600c:3ca5:b0:41a:b54a:9ad8 with SMTP id 5b1f17b1804b1-421089fa29dmr70623995e9.0.1716853520726; Mon, 27 May 2024 16:45:20 -0700 (PDT) Received: from airbuntu.. (host81-157-90-255.range81-157.btcentralplus.com. [81.157.90.255]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42108970967sm123535515e9.17.2024.05.27.16.45.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 16:45:20 -0700 (PDT) From: Qais Yousef To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Steven Rostedt Cc: Vincent Guittot , Daniel Bristot de Oliveira , Thomas Gleixner , Sebastian Andrzej Siewior , Alexander Viro , Christian Brauner , Andrew Morton , Jens Axboe , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org, Qais Yousef Subject: [PATCH v3 2/3] hrtimer: Convert realtime_task() to realtime_task_policy() Date: Tue, 28 May 2024 00:45:07 +0100 Message-Id: <20240527234508.1062360-3-qyousef@layalina.io> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527234508.1062360-1-qyousef@layalina.io> References: <20240527234508.1062360-1-qyousef@layalina.io> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit As Sebastian explained in [1], We need only look at the policy to decide if we need to remove the slack because PI-boosted tasks should not sleep. [1] https://lore.kernel.org/lkml/20240521110035.KRIwllGe@linutronix.de/ Suggested-by: Sebastian Andrzej Siewior Signed-off-by: Qais Yousef --- kernel/time/hrtimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 89d4da59059d..36086ab46d08 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -2073,7 +2073,7 @@ long hrtimer_nanosleep(ktime_t rqtp, const enum hrtimer_mode mode, u64 slack; slack = current->timer_slack_ns; - if (realtime_task(current)) + if (realtime_task_policy(current)) slack = 0; hrtimer_init_sleeper_on_stack(&t, clockid, mode); @@ -2278,7 +2278,7 @@ schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta, * Override any slack passed by the user if under * rt contraints. */ - if (realtime_task(current)) + if (realtime_task_policy(current)) delta = 0; hrtimer_init_sleeper_on_stack(&t, clock_id, mode); -- 2.34.1