From patchwork Tue Jun 4 14:42:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qais Yousef X-Patchwork-Id: 13685475 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 5C2ADC25B78 for ; Tue, 4 Jun 2024 14:42:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B6F776B0085; Tue, 4 Jun 2024 10:42:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B1F966B0088; Tue, 4 Jun 2024 10:42:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E6D66B008A; Tue, 4 Jun 2024 10:42:47 -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 809886B0085 for ; Tue, 4 Jun 2024 10:42:47 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 02E8880BD1 for ; Tue, 4 Jun 2024 14:42:46 +0000 (UTC) X-FDA: 82193472774.15.1F39690 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by imf07.hostedemail.com (Postfix) with ESMTP id 05DC64000F for ; Tue, 4 Jun 2024 14:42:44 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=tw10PFBl; dmarc=none; spf=pass (imf07.hostedemail.com: domain of qyousef@layalina.io designates 209.85.128.49 as permitted sender) smtp.mailfrom=qyousef@layalina.io ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717512165; 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=8jnKGJySu9h8dQmXOQLdoPh0h1DTnfmclVsZLb2/cVI=; b=ukTmd9y4VzKYhg3Filv6YGs2nk6DZdoL6lW0NtOq7qb3pPF9lp3DcxhHRp8nYmAjb8UT/B C0lNbW9TyRwOWo34B2ArNMlq81ZFMQrwReIzSy5wK7BTykmY+oVLJsnzgLTWHPzqKGml6F gLs076tUQcGi5WrmEpkYzvuFXAHXjdM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717512165; a=rsa-sha256; cv=none; b=uDlT+tjlZn8OKIcvVcu0hjnjL96ldSgFjUoaoyMngCXcSqJR+pSXIXICDyJDM22TJGWZgw Y/kCdYrkjPDobgiFcQF48EjOI0QlSGAM6gQEmmtvdmfib7oNWBMZUcJZ7NTD9y9Al62o87 4VlAnPCMrGH+EL0XKcagcnhBlgnb53c= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=tw10PFBl; dmarc=none; spf=pass (imf07.hostedemail.com: domain of qyousef@layalina.io designates 209.85.128.49 as permitted sender) smtp.mailfrom=qyousef@layalina.io Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4214053918aso11237315e9.2 for ; Tue, 04 Jun 2024 07:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1717512163; x=1718116963; 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=8jnKGJySu9h8dQmXOQLdoPh0h1DTnfmclVsZLb2/cVI=; b=tw10PFBlAwpbax5jjL3WdcmKwzhCGKeTWcmlcc8HtCK9R8a0DG5NNsIGj8neC0pvkY bPC3UNNILXH9qLPMQ0avkvIOPK4tld/YCXpf8jzMZL1t38v8tdIU/ApzVOviC7qW+Nog OYv2Iz9a1RESAq+sR1w+yrUNpXWquXlZZUvKgHXs+Yp+a4YD3bV8+1KY1nmPxG7qmyl5 cHRgGEpmixzt4LwaLvJqgU3M1U4hy1NBgwRp3FXvCKu+Zk0Ys5AH7W3RTjTq+PRbw6nP 0lJJO2THil0wop0rV7WQ73In7av7SEvDiw2Ugd1gSN58yp+8xIAnuPE3i25R1p6DRoBt xawQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717512163; x=1718116963; 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=8jnKGJySu9h8dQmXOQLdoPh0h1DTnfmclVsZLb2/cVI=; b=UkWJqtvVg97VuXm2uLGbFMF2dD5egGUl8WIMVtb7w8/7TCs7smJh6IdLdQ8dqsl93m jh5sxFZNHxQnVP/qcM9ETAMg15ceSfu906tUiQH04kSiXZiOhxLvOnyHJskL4q4y1K9u htXBfoKl7Fa7rOkjd6Kp1qdpsXNbF0AZ7e2nwZFjJTfWA4lY+znO/eD6yYJvAUDkoAfG YAHtLkED/SiS/LDwq1s8iYzQHk0fCcUIE8UP+wmI0xAvq90EjZJ/pNJsArrWoEC1pNcu yP1TWigYVH6h5rYP77IplzY1ZzjWhFhjOIO72ni4bC9+efCxQunDSP6qB69RO/Qlh18V mLxw== X-Forwarded-Encrypted: i=1; AJvYcCVp0Xm9L1ucW6pk8bxUqKJEng88gBEsnjj8PwXlOu/LBKjg/5FJFONkcSbsImMVqgnJYVJ9DqT2TF253GDFwQibwh0= X-Gm-Message-State: AOJu0Yw04P+JIzGGrRqdyWZHTaOdhrjWb1izb91Xf6a9z4nb4FfXRAXb w5C4FaIEIU/xP1g+ZaXVZwjPENkireAcyulL6p2ZpK5qGLrcNRvgvvn3tSW73EQ= X-Google-Smtp-Source: AGHT+IFHyXe61JT/ocdpGZbrwDVdMOmBXRW4tJ1GcV6IkVgsEhaXirpg5hiOocDOW3cnr3WEDVJn5Q== X-Received: by 2002:a05:600c:1d85:b0:421:2efe:5aa8 with SMTP id 5b1f17b1804b1-4212efe5bebmr105827485e9.18.1717512163384; Tue, 04 Jun 2024 07:42:43 -0700 (PDT) Received: from airbuntu.BoongateKia.local ([87.127.96.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4213eca8a51sm62423295e9.14.2024.06.04.07.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 07:42:43 -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 v5 0/2] Clean up usage of rt_task() Date: Tue, 4 Jun 2024 15:42:26 +0100 Message-Id: <20240604144228.1356121-1-qyousef@layalina.io> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Stat-Signature: 1bj9qx6z3wp5csgbq6qcfmbmc7iofgwf X-Rspamd-Queue-Id: 05DC64000F X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1717512164-793711 X-HE-Meta: U2FsdGVkX1+AZioZ97SmSG3MrjGlCmZtG7KjIG8s1gMqd3J8v2BnpKAWPTcISdB9PYrjXPA+pHmbC955CAgWEHyUun9c2wLGkeZVqksfYScI2SdikVeIGx1U5T/khcGJORqKrt8pWVSPFPCfrzM9GxxsbtwUfju3vF8+b7ADk9R0J2Bxu1WPJ6Dfj5ZIpeZdzppdUi+3b5t81aUcg4GGqJa0N0Wcglcm9M0VKFledTVn09NgSlHjTL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p7C96GukIReuHKi0JykCyJf/VI+i2YzF3W8QbLbAbfBw8avPpUk27FnaFD/CWD/fiqyOrLmbA3pHYpPxdjuQ/+DqWQDxKrqpYqHKAjH1orD3kztGtGEVmie23xHG8+6oK43fNcDRpE4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000221, 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. Changes since v4: * Simplify return of rt/realtime_prio() as the explicit true/false was not necessary (Metin). 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/ Qais Yousef (2): sched/rt: Clean up usage of rt_task() 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 | 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(-) Reviewed-by: Sebastian Andrzej Siewior