From patchwork Mon Jun 10 19:20:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qais Yousef X-Patchwork-Id: 13692377 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 9D2EDC27C55 for ; Mon, 10 Jun 2024 19:20:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 12CE06B0099; Mon, 10 Jun 2024 15:20:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DDF06B009B; Mon, 10 Jun 2024 15:20:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBFDB6B009C; Mon, 10 Jun 2024 15:20:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id CCE4A6B0099 for ; Mon, 10 Jun 2024 15:20:25 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7BE5C80EC0 for ; Mon, 10 Jun 2024 19:20:25 +0000 (UTC) X-FDA: 82215945210.02.456A5AA Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by imf26.hostedemail.com (Postfix) with ESMTP id 910B9140020 for ; Mon, 10 Jun 2024 19:20:23 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=gZbGr2UZ; spf=pass (imf26.hostedemail.com: domain of qyousef@layalina.io designates 209.85.221.48 as permitted sender) smtp.mailfrom=qyousef@layalina.io; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718047223; a=rsa-sha256; cv=none; b=6f7NbgPzXfFLqWTmMCjAMO5ZJSZod9CmbtpDPsceVc2MK7et5t7iwTjWFbdrzvlEZO9BST 1pZHeovvadO7STeqSOCH5rN9gj6/EnK9uHsdyCJfmZHN6k7Xv9uHJNFxxTjKvdxxWfPVl/ Fe1W5L+/ZNx/ZMO/m6coFDJg+qCmMIQ= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=gZbGr2UZ; spf=pass (imf26.hostedemail.com: domain of qyousef@layalina.io designates 209.85.221.48 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=1718047223; 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=Guz7MjyMNC45VGVGtnc1o6ogeR5taFihB6DV18NWqFk=; b=Gyk2x5dy/v7HlBJ+QUzNfpFl6RPvaDuGtoeyvZOVZyHBeB/YsRtVbL4Y/BZnQJ5xDGeFiK D3wkQocIUE0uUhk0ghVbpv2IPA6Ymorr2ohg3DMOIcEmpRh3PuvtauVSwcfeKfFElmShTR HwoQX3pRt5z7dQaSiQx4DM9KNPcVfwY= Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-35f22d3abf1so1399815f8f.1 for ; Mon, 10 Jun 2024 12:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1718047222; x=1718652022; 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=Guz7MjyMNC45VGVGtnc1o6ogeR5taFihB6DV18NWqFk=; b=gZbGr2UZiYVNord2j94kq/llPdbwNxCPl7QrF5oCWAzKs3N4im/dIeXoLWKzpF8XUG qVoPaK+CJ4J/RNQ16kd6jkHXzwjknDWOdWYnhy++phuFT+kktQqdpNJ+W4P4c8mBlPyk EafBh20PNbSE0imsSO1156INveiSjDLVqeXMdsOjxl9bCerTnh6ssYyVQJ0/YX6LlsYm A40K114r0vZdSQRV22Apt81XPNB/l9qSyPm3dsjGoScuWXHkib7MRCZSYtzR+7rB6N8x ULXdrmTRjT6dVmRGl/Ww5cLhrex1OJyiRB9mePZT/VksQTrHChnRQx7UF9tb5WTCc8ih Q14A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718047222; x=1718652022; 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=Guz7MjyMNC45VGVGtnc1o6ogeR5taFihB6DV18NWqFk=; b=dWychd2+6pp6P35P+u+Inz3LZIPotO5xbSKjN0pT2KCNjIPX6dW7X+mFn0YiFKE5Pd O6Xkup6A2aDFk5G0PZzHyJ1MUt5faAhiFRuoOKBqhyHQaEJYYRbbw18sf9k20WG09TwG LJPcRxoZHNf86mcz3ivZD7B14fAXJvArgONcwATV1NmYykEToRcD9KY5Qy19Zf22UAr7 JjxcxfIeyit1ZjXt07XNgSA/0B2XDAIiRtVdDfDmLP3EHH+3grRC9hRp3N5bpIdL2lAB LC5KzwGMbOmEuioA+FPQwrQT3EhDxMnnH4BloJlWRmJQpzqwlFkz9isd2LQYLWHaJZXd PlJA== X-Forwarded-Encrypted: i=1; AJvYcCW815dwXQTYNKKhRYFnGNS6ITPflfi1YbzbNgLboAxV92/POnpj0V0HQ9lTJO1akqlxBwugNRsNdfMcuzCXNd5fZFU= X-Gm-Message-State: AOJu0YyFdFlWGLWwZQRBS7adD5UGWOMXew+k4nIVZ017toC8wOqAPJ6Z GbTLy0AXj5+ON2YpzrTNg/gh5inpwGYb12pS7DiaAm4ZM0COOlZ4TVDR3f5n2uA= X-Google-Smtp-Source: AGHT+IHq8jSEMkw7gwkS01+qTAl/yGpwM7w1xlBZWuVyZXGP6Ki1z+5dsHApq2plP2vN33SQwO/EeA== X-Received: by 2002:a05:6000:1886:b0:35f:17c8:fe2d with SMTP id ffacd0b85a97d-35f17c8ff54mr6394663f8f.37.1718047221959; Mon, 10 Jun 2024 12:20:21 -0700 (PDT) Received: from airbuntu.. (host81-157-90-255.range81-157.btcentralplus.com. [81.157.90.255]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f1f30c3ccsm4988326f8f.7.2024.06.10.12.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 12:20:21 -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 , Metin Kaya , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org, Qais Yousef Subject: [PATCH v6 0/3] Clean up usage of rt_task() Date: Mon, 10 Jun 2024 20:20:15 +0100 Message-Id: <20240610192018.1567075-1-qyousef@layalina.io> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Stat-Signature: 3j94o1by8espfw4k5ff1g7dfhw1ii7bg X-Rspamd-Queue-Id: 910B9140020 X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1718047223-206820 X-HE-Meta: U2FsdGVkX1+HN5NpPbyBoVxvBeGN5IU+ij0fGn4paJV47pk78Q89b9DO/BN7VWJRYvT9eRsj6no0YxrnR+gXIluPWQNb/Y7PtB3c8+AGGkBS39FGOhS+FyhhUlFjs4pPLMR40il8uVl0VS8Tdd1lwD97QuIjibjPzoo1xShJdk56oCXyeJNXcvt5xdQDXID+gniVMqRkerP8XK2B1FAzb7QHQKRGOWeWT50F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Xku/wAaSWArGwI2p6eyDdrIu+jpr2SaFRYNpmuotU0IOIg3o6h3PaJEdYVQ7sNv9woDsTAfi8hykihSJ/1zCVGYXAV2j6Hw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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 cleans up the return type as suggested by Steve. Patch 3 uses rt_or_dl() instead of 'realtime' as suggested by Daniel. As the name was debatable, I'll leave up to the maintainers to pick their preference. Changes since v5: * Added a new patch to s/realtime/rt_or_dl/ as suggested by Daniel. * Added Reviewed-bys. Changes since v4: * Simplify return of rt/realtime_prio() as the explicit true/false was not necessary. Changes since v3: * Make sure the 'new' bool functions return true/false instead of 1/0. * Drop patch 2 about hrtimer usage of realtime_task() as ongoing discussion on v1 indicates its scope outside of this simple cleanup. 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/ v3 discussion: https://lore.kernel.org/lkml/20240527234508.1062360-1-qyousef@layalina.io/ v4 discussion: https://lore.kernel.org/lkml/20240601213309.1262206-1-qyousef@layalina.io/ v5 discussion: https://lore.kernel.org/lkml/20240604144228.1356121-1-qyousef@layalina.io/ Qais Yousef (3): sched/rt: Clean up usage of rt_task() sched/rt, dl: Convert functions to return bool sched/rt: Rename realtime_{prio, task}() to rt_or_dl_{prio, task}() fs/bcachefs/six.c | 2 +- fs/select.c | 2 +- include/linux/ioprio.h | 2 +- include/linux/sched/deadline.h | 14 ++++++------- include/linux/sched/prio.h | 1 + include/linux/sched/rt.h | 33 +++++++++++++++++++++++++------ 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(+), 31 deletions(-)