From patchwork Sat Jun 1 21:33:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qais Yousef X-Patchwork-Id: 13682557 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 5332FC25B76 for ; Sat, 1 Jun 2024 21:33:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B11686B009E; Sat, 1 Jun 2024 17:33:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A8EFD6B00A0; Sat, 1 Jun 2024 17:33:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 987E26B00A3; Sat, 1 Jun 2024 17:33:34 -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 78BB06B009E for ; Sat, 1 Jun 2024 17:33:34 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9F2B0A103E for ; Sat, 1 Jun 2024 21:33:33 +0000 (UTC) X-FDA: 82183621506.30.C35C1AF Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by imf17.hostedemail.com (Postfix) with ESMTP id AEF0840015 for ; Sat, 1 Jun 2024 21:33:31 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=S1d5jVD7; spf=pass (imf17.hostedemail.com: domain of qyousef@layalina.io designates 209.85.221.53 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=1717277611; 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=HJt3Ya3JYlNDKcCqPU+4dBowkDesFTehUTcWLYXANYk=; b=uiochxwnxNqgl4dqvV6JK/1IrLJO7dhEY1RHfSmJhx/YcWwhETdCkNnBmIIDEzvVYFu5we NKxCFaxa1oXrtHw+CurIzsga+pSRVRDg+Stck4jgjWLvq1fZn4lepU2Tbv29GEkNh44u2T fXNHZuiVY+2vxhMCTt/BLX/mRdH8wh8= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=S1d5jVD7; spf=pass (imf17.hostedemail.com: domain of qyousef@layalina.io designates 209.85.221.53 as permitted sender) smtp.mailfrom=qyousef@layalina.io; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717277611; a=rsa-sha256; cv=none; b=7v4j1kHD2tQjkN7o/lqmn9YgtZBuAX3FN2VI+xciK/fndpY1uCf00BeRwW+IY7Cx71zUHC qF1H/rgj+i3x6K3l+Gzys3efg4peUFih4YSBjhGdQDBOALIQA32KjnQXZg+voeHeTljsr9 X+dMAq0J2DPNgHChnqpb43U9kwVGCIk= Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-35dce610207so660519f8f.2 for ; Sat, 01 Jun 2024 14:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1717277610; x=1717882410; 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=HJt3Ya3JYlNDKcCqPU+4dBowkDesFTehUTcWLYXANYk=; b=S1d5jVD7ZELffUxsc+E2YW5KNo6ytNtyURD995bZuAbIqDqrJcFZwGKqXEkIcYD3mJ pRqJVU5iEKib2364H1TOfOgA5vRuEonfgLM4bf4OyUKrrUCK2q+TgD+zEYEFiL/oSSkX MeVPUzgYcAxIf3niDSKwZx7tiUpTKx0V5tHsD19F06a1RWl0QIuHALL6UqTsWV037UYB R9Md1NIOuK3BUNIB/TGyBzyD0G4qaJeQC6CQoOrXQiF6P53yc1AVoktuyFtCNWFGUtnG DfQQY1BUovZzhn8RlPJbvOdBWLI4FmGekVwLYolQoBKNXn1x/6HVSQqYCMbk3OcQoPmF PW9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717277610; x=1717882410; 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=HJt3Ya3JYlNDKcCqPU+4dBowkDesFTehUTcWLYXANYk=; b=AjDSgzmqkgqwad4/pGZjMGnoAX0RTxBZLi2EUha7QZp3uc1/G2GkUNJvz+coxp/2Hw HRYcPYtIten4/vj9PciWdiWC+eEhbKWxivq8CJnS+ChK+Zz9SIn+MmY5ARcewnp3S/aW L9Lxtcis5bUNXpHWkfc6LFr5Bf7H8il6ooaT5tdu/dD1P+LNmwP6iONI+WiwKVXClPY5 +zqq+uGB1vWVciRcvS8r6SO8IicW/KDTgDsFy//Og4Ld4fQRS8WvH/BZknVq4xUlo8ow TB3XCLoBdTVLd1mW7/17zlAarmYfjxpd1PcW1YFotgRcHIXtAB48Dd0PHdeW6h3xA0qy tKww== X-Forwarded-Encrypted: i=1; AJvYcCXxGtfHDfxa3XmT5eKjoqTQHnyqLxMHKe6LmnbWlrXjobxZDEG4W/LWM89PnjP09QohsJReZwFZOyTQCJNdh9SOpFw= X-Gm-Message-State: AOJu0YxtGifJQDZKxKttYf/aC+SRmqarKEmIlE4CoFObXn+pWnUw+Or6 6L8eqkjdVOUkfAPkJcVMy1dGShFhZnGFn78cOXYKPyOttzJw5n+omPpTIDhZVFl+0YRS/plR/W7 JyLk= X-Google-Smtp-Source: AGHT+IGl9Hl1b8VRJQpVpXl7hCsSBOPLOHgRsVLux3bAWL4Geb2ApKKwM1lVHyceYADVoADXs17YOw== X-Received: by 2002:adf:e80f:0:b0:354:f724:6419 with SMTP id ffacd0b85a97d-35e0f25509fmr4554299f8f.8.1717277609843; Sat, 01 Jun 2024 14:33:29 -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-35dd04c0839sm4751324f8f.23.2024.06.01.14.33.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 14:33:29 -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 v4 0/2] Clean up usage of rt_task() Date: Sat, 1 Jun 2024 22:33:07 +0100 Message-Id: <20240601213309.1262206-1-qyousef@layalina.io> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: AEF0840015 X-Stat-Signature: zu4a74khysm1nuxiq1ptkem85on3dpzw X-Rspam-User: X-HE-Tag: 1717277611-69573 X-HE-Meta: U2FsdGVkX19/Yfok/BVJMekX1JF3wDbM+xjgztXJ6fhpF+TJBQYFsbMcNE3VlYr4zyLNcdq4yc0Q4mub/o1IWyO22iMTBjCPttTSszl98zYJ0Bzb4xGlLecRHZgySUeQplokh91P+PD9PvzAwFGr5NKORyuhfPYkAb/9QEo9ZPFRrFq+nUGNuWxuyiBd7Nvkb2vm3H6PyQA2nSvHhq3xJy7/e1cIzfSI9u7pycrqTdGWVgHtbjJp2JZyw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5JxjjWzdcwIqutmYpka3ZAseOQR2B6AeRX3/Ncak7iJwwXlnfP3ZHktjnOp1RQ3jeP7+pTKE4mjDCuv1TbiH1VUbChhpoVCtIMvWgzPRxUT2ocVtQ6ywstOJ4LgqtEoo/rWIoCij79HXxm86t2VSpzCCBkjaV2K0w= 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. 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/ 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 | 35 ++++++++++++++++++++++++++----- 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, 57 insertions(+), 29 deletions(-)