From patchwork Mon May 27 23:45:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qais Yousef X-Patchwork-Id: 13675935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2000C25B74 for ; Mon, 27 May 2024 23:45:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F28E6B0083; Mon, 27 May 2024 19:45:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A2196B008A; Mon, 27 May 2024 19:45:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36A476B008C; Mon, 27 May 2024 19:45:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 17EF76B0083 for ; Mon, 27 May 2024 19:45:21 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 885BD801E4 for ; Mon, 27 May 2024 23:45:20 +0000 (UTC) X-FDA: 82165809600.04.7B26795 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf15.hostedemail.com (Postfix) with ESMTP id B0EFEA0009 for ; Mon, 27 May 2024 23:45:18 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=NYzUs09q; spf=pass (imf15.hostedemail.com: domain of qyousef@layalina.io designates 209.85.128.46 as permitted sender) smtp.mailfrom=qyousef@layalina.io; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716853518; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=sRO/CnRPtpBsbl7nBhwPcIaynZHQudWyGgLN4ebnUfQ=; b=lc1rROt5AffkT7NeiIt7mMVkLLymNHXJWiRj4wGT4GbruklalXmMu+j7j1pMuORPiajPo0 E+U5MXeiAdDFlFQXJ9jrR/oX9xWhWuc/kdMKsHB9O6XyYGWk4TTtIsi8MqqCsYxVxHBgvI BAzxGZLF7vJM13twuuwglZ1+K795kmA= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=NYzUs09q; spf=pass (imf15.hostedemail.com: domain of qyousef@layalina.io designates 209.85.128.46 as permitted sender) smtp.mailfrom=qyousef@layalina.io; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716853518; a=rsa-sha256; cv=none; b=26yzwsBV9z8ZIp5sh9ncZTVDlS0jsLqFQ7PUWnTmn0/1IdUwINQ8HZjXrhkEMKRpD+PKOJ Dkxlv0jjXPwytVrVwn8kXF4xtkhdQ9lUe4PP7PT9S+5y8Xz4PGwI6VD7zpWiLR/mZJ2cus LzZM1gB+pnRhDKZFNvAvkJnMGwvTpaI= Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4202ca70318so1536625e9.1 for ; Mon, 27 May 2024 16:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1716853517; x=1717458317; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sRO/CnRPtpBsbl7nBhwPcIaynZHQudWyGgLN4ebnUfQ=; b=NYzUs09qap2C4XVLZKZpgPrkUbsNZjeeizrsFzn6b+kVbSiCAq+FUASIJI397psDpu PoAfg1iC7eOgFnvGKswYUJJanoJoNCJiU8Fy1sORcUoCOiygyHb1XF3pTciSEhHmCyQM ZyrKkbyRFRm/G0rfCFHjHq62GCRx6H0k7vvXqnlXoQvwhz7WQ2ZcAuGJgjemb98ZeLQr FlcqRMIiE3nFcnoEraGQob5WYyhXkOPgBr3xBcQJBeWjTvRWkb0tUr9pnY2iKlBsLcKs fv8jimCsVUgnGXMI6uQo6SjvTgu6IDOdiH1Yjw+uVcfNibZHr8EBN3UcBxDkTcRHxJ+3 El/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716853517; x=1717458317; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sRO/CnRPtpBsbl7nBhwPcIaynZHQudWyGgLN4ebnUfQ=; b=LU5VwVxDrPve3EB1+EW2uNxWZqnobdRlazcyyqtEy/JB+JYw37bRFxHu13oDO4nEd+ IBYdo8xijkycJNY+ZGjs7onwbBLKAgnpSP4yTsKpXnCqYMO+QFFwj5b/etE7cAa+EvOJ tqBaBeC8Wgf3PHKtHS7+nI7LSpGkc8ZQVVCS4YrX1V5la3A6ivldb+RL3EP9GD40RwP/ LhNIgZFTByOS5n15a+q5mDhHffI0ib29UN5FlT2hS+99++hnbG5KJ5+M3PSvBZ9SIGTB 17Qzt7G57DEbqLQ8Fp6TFijiqle7eKG04cMuHGLZSODmn8wjZ2IRsesbSziQobQIu+Fi 9RjA== X-Forwarded-Encrypted: i=1; AJvYcCWfPLgKNL4ri4DQGJmERU3Uxvwp7ELaI8AUZrfCS4Q8ba2sWXVx9+yL5nWj2gvckvnuOZMbKvB436scYMaXryYpXCA= X-Gm-Message-State: AOJu0YyCacrM5oQdWcDO9st3+qOTjuiGABzsU2A7UjowIWtgMV68TJH/ nNPPszDG8J2OAaqRNG++N+VzIfLG96AhFRKjJDmprBhxoX446QAxzu87f5mec3E= X-Google-Smtp-Source: AGHT+IH9cpBoOavUU39BKyiX5ZVVtYqsyiD57pc9wsnRSAnUTzf+Xg02xdlAzGi0KOkEJdwOY+claQ== X-Received: by 2002:a05:600c:6b04:b0:41f:e7ac:cc72 with SMTP id 5b1f17b1804b1-421089f9a09mr75891875e9.40.1716853516966; Mon, 27 May 2024 16:45:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 16:45:16 -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 0/3] Clean up usage of rt_task() Date: Tue, 28 May 2024 00:45:05 +0100 Message-Id: <20240527234508.1062360-1-qyousef@layalina.io> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: B0EFEA0009 X-Stat-Signature: 8jmraegrha37tx165qhfdohudx94xeyf X-HE-Tag: 1716853518-739751 X-HE-Meta: U2FsdGVkX1++s3PCC+wHZXpTuIKME6r+Ea1u2mCY6MRPsQLjxTDzROuGgOgARQi/Pu+3VD5zYNJsXjOqIl8N54k2CEOcSeMFIZvRtxRyXlhxsCo5TkQv5+m36gZzyCT0uW/z/csVSNN9KZRkGFfuda9A8CNyaecoZNC7YKjJVPVmoOFh8Q1smbqA120qeFdbBgLXzV1UZ2tHxmmpLPJ2IbJTrZcMI4bgkVHRPspNhjh9mMe9fFJHOnMHMy4PWN4cGYWP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3YvWwJQAG/9sAoQCtnTBQBD4XmZa+eNgZG+7Czf1lc2sJWbh/RY81UCwj7QdJSmcsSBsw54TTz1CwNA5Gsg2UJHN151e6YcUHAu1a6ePuQIVs6s1qzi8XrA5R0fqEdeWXIbhSFeZQMitXZR/lmnrG8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000013, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Make rt_task() return true only for RT class and add new realtime_task() to return true for RT and DL classes to avoid some confusion the old API can cause. No functional changes intended in patch 1. Patch 2 changes hrtimer users as suggested by Sebastian. Patch 3 cleans up the return type as suggested by Steve. Changes since v2: * Fix one user that should use realtime_task() but remained using rt_task() (Sebastian) * New patch to convert all hrtimer users to use realtime_task_policy() (Sebastian) * Add a new patch to convert return type to bool (Steve) * Rebase on tip/sched/core and handle a conflict with code shuffle to syscalls.c * Add Reviewed-by Steve Changes since v1: * Use realtime_task_policy() instead task_has_realtime_policy() (Peter) * Improve commit message readability about replace some rt_task() users. v1 discussion: https://lore.kernel.org/lkml/20240514234112.792989-1-qyousef@layalina.io/ v2 discussion: https://lore.kernel.org/lkml/20240515220536.823145-1-qyousef@layalina.io/ Qais Yousef (3): sched/rt: Clean up usage of rt_task() hrtimer: Convert realtime_task() to realtime_task_policy() sched/rt, dl: Convert functions to return bool fs/bcachefs/six.c | 2 +- fs/select.c | 2 +- include/linux/ioprio.h | 2 +- include/linux/sched/deadline.h | 10 ++++++---- include/linux/sched/prio.h | 1 + include/linux/sched/rt.h | 31 ++++++++++++++++++++++++++++--- kernel/locking/rtmutex.c | 4 ++-- kernel/locking/rwsem.c | 4 ++-- kernel/locking/ww_mutex.h | 2 +- kernel/sched/core.c | 4 ++-- kernel/sched/syscalls.c | 2 +- kernel/time/hrtimer.c | 6 +++--- kernel/trace/trace_sched_wakeup.c | 2 +- mm/page-writeback.c | 4 ++-- mm/page_alloc.c | 2 +- 15 files changed, 53 insertions(+), 25 deletions(-)