From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 118023DA7EC for ; Thu, 26 Feb 2026 15:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772120562; cv=none; b=jbkAM8G3nIsl6kc2K8wtyQLArdj7HKVw6C6XaZQS1wMPjzY19pi5l8JwMl2jtLWKs/bgqjcPdAmTdQtt95//Kyubyz2CqFGjOM8FwwiCAmdKXnu6gXnfGDibkNsMf4Vw2qgRN7f11oxNBShrmVLEP0jeQLWxGjanKAm85g2vQ4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772120562; c=relaxed/simple; bh=XLrjsAlcAPn8bgmeYgraZaALBhUhHzDOlAnT+O4Msi8=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Yfthl/rVKuTWEz/VLOz5aiXiNDRDmqrILO0XTl8z91PiOpzyr9xIt5VlGEFn4nngj8nBp6yYtMns+weH42BK2AaTeKapSeZ6sJOkfoi69TP8pQc58HwTJT6sfZSklW8rpIMC42IyvAWrljVrAmwKBNu+tZ6rsgsFhkz+6FTRzN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=X+IpGs65; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=SdocmKvs; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="X+IpGs65"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="SdocmKvs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772120560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=f0OUF3CLsanKAY3ZZyBsRNqIRW+r0UpA/BjJW9RCyhQ=; b=X+IpGs65VlN/OJJTuBlX8wnQLkF2M7hRHbrTpzej0+DhLkWJ2VY4Dr4hmkK8Q9mwNkdJSh xkUjS1tMo6AtaN+qLXQGYe9g34ZdOJVxeD8qgURMB/fkUcx5nwl6mtqpc7YtmVgWUZwjCb ipV8eHFyf8/NcTjziymaSQUl6xRAv6A= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-615-FXCEvt7QP1KdCSalG05Mpw-1; Thu, 26 Feb 2026 10:42:38 -0500 X-MC-Unique: FXCEvt7QP1KdCSalG05Mpw-1 X-Mimecast-MFC-AGG-ID: FXCEvt7QP1KdCSalG05Mpw_1772120558 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-48378c4a79fso11438385e9.0 for ; Thu, 26 Feb 2026 07:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1772120558; x=1772725358; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to; bh=f0OUF3CLsanKAY3ZZyBsRNqIRW+r0UpA/BjJW9RCyhQ=; b=SdocmKvsj3R+6w46Bsju3uKT4Rejzjww/4sVhbpBIouXfCAXUgx+DJREDBZI0HTuNi BHpUcVwsBD3g8Xee0Z+KwaHng9ZKPLIu/oQHa0f8aeplBSsmICIGmb6dLGS3FllDWLVy 0GXVkJ3zBUqKPRs43B9a12atYmDNae9mRAHxdt6+GzlQwA+SF6+iHb473g7CAaqpDhgg ddxNzExjyqzj3sT/EG5/2cQA+bEpWrJQWSDuBOEruvgoNI+aInD5Orof2DBLSyqMlqaU uHcEMsWyYYbhk+L1ABnolbdDa7oqR9WwDkmuQusHj108MGBiBi+fROUxT8bZq5f7ngL4 skMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772120558; x=1772725358; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=f0OUF3CLsanKAY3ZZyBsRNqIRW+r0UpA/BjJW9RCyhQ=; b=Bw/uJ6SeklSKBor7HhySeZTEpEsYlTsz+rj5fgtyHaH7CPolbEKV6bibeb5L9VuGUO smBGYiN/CKfIj27mEfk6oubXMSrvOHjUAfsKNolUkrMTPuCRQwqvoiE5HGlyVEQm8vbq Oi/4F8dAsrFKK06HPWnloOdx+ao1EmfPDuDzRlc7S4fjFO3GVyNiXVpGcZEJ6zVg7Tts UGEmrac6VZvgPWyhj23R1tTHdGpzI9Q6cMVlERQb9OwF6OpvDTkaR4b+eCVKltS19bMR S0chyi2MW+OdwKkAzkoFSI/EtDN0BWPIH8QrwnAd/nrvmTm2amsLS72LVPVlKX2vMPtB aAqQ== X-Gm-Message-State: AOJu0YxWM87J3ZsVpZdahfIWxHz5+Jmtspg2xI6yqrFVujRM1UoO7nan l8woSlhgR5zqlEPTDWRK5vHBRh5FS4O6mxezwpwO7ojvCzd1BU02gI6hmiWE7iCBlxU8mAzT8NL mIrMsSkqzR2U5Kz9+fEsLg4GU/F8xfrVPai946YgezCHxDLQPCzQ3xZpiOemX5hNDKw== X-Gm-Gg: ATEYQzyw8dvHli0Jb5pAnjRUxlBTJKfpmO4pz65Ty+Kh3zhom/XFMgndsi905w/CT69 kmX27kXx90/f0LUoMjxWwhos7iBSaaxxV7bqQWRfE0EL7ce+r7WESdGfpnPgEBn1lgkxrfBWzb2 xH5hfvgRP4IImhew1+qdlEx2SuR9OdfLNg3dqNcSxwIGMNGdAfqPSJ/aZc81KL6p6XDC5TI3WsU 38szPvJMwGhZPx9VGZ4fo5PxnLmmAHUAd5X2+qVtapv1AsLfgns8enEy/tuW53q8DGE/mUDVRxp vOebwbei6GtqatzjNp4aXNBwHhXj7cpdZO0dxxG+7MC6KKDWK35uWtxH7AYLezjxQi1Y0rDWikd 4FeKXx+tkRV7GYUNYp6GGvyg0MeZAg07eaDjMTGpFBXjN0kpe7HVAvannlK1lWn+u+XVxoOGgaS mYHXU+hao/NMcqLWQ= X-Received: by 2002:a05:600c:548a:b0:47b:de05:aa28 with SMTP id 5b1f17b1804b1-483c216ab3fmr81183555e9.2.1772120557654; Thu, 26 Feb 2026 07:42:37 -0800 (PST) X-Received: by 2002:a05:600c:548a:b0:47b:de05:aa28 with SMTP id 5b1f17b1804b1-483c216ab3fmr81182975e9.2.1772120557143; Thu, 26 Feb 2026 07:42:37 -0800 (PST) Received: from gmonaco-thinkpadt14gen3.rmtit.csb (212-8-243-115.hosted-by-worldstream.net. [212.8.243.115]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483c3b89c99sm51321425e9.15.2026.02.26.07.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 07:42:36 -0800 (PST) Message-ID: Subject: Re: [PATCH v6 14/16] sched_ext: Export task_is_scx_enabled() for verification From: Gabriele Monaco To: Tejun Heo Cc: linux-kernel@vger.kernel.org, Andrea Righi , Joel Fernandes , Steven Rostedt , Nam Cao , Juri Lelli , Ingo Molnar , Peter Zijlstra , sched-ext@lists.linux.dev, Tomas Glozar , Clark Williams , John Kacur , linux-trace-kernel@vger.kernel.org Date: Thu, 26 Feb 2026 16:42:34 +0100 In-Reply-To: References: <20260225095122.80683-1-gmonaco@redhat.com> <20260225095122.80683-15-gmonaco@redhat.com> <8fbc3ced19fb0c2a2171708073fa51ae308755b5.camel@redhat.com> Autocrypt: addr=gmonaco@redhat.com; prefer-encrypt=mutual; keydata=mDMEZuK5YxYJKwYBBAHaRw8BAQdAmJ3dM9Sz6/Hodu33Qrf8QH2bNeNbOikqYtxWFLVm0 1a0JEdhYnJpZWxlIE1vbmFjbyA8Z21vbmFjb0BrZXJuZWwub3JnPoiZBBMWCgBBFiEEysoR+AuB3R Zwp6j270psSVh4TfIFAmjKX2MCGwMFCQWjmoAFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgk Q70psSVh4TfIQuAD+JulczTN6l7oJjyroySU55Fbjdvo52xiYYlMjPG7dCTsBAMFI7dSL5zg98I+8 cXY1J7kyNsY6/dcipqBM4RMaxXsOtCRHYWJyaWVsZSBNb25hY28gPGdtb25hY29AcmVkaGF0LmNvb T6InAQTFgoARAIbAwUJBaOagAULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgBYhBMrKEfgLgd0WcK eo9u9KbElYeE3yBQJoymCyAhkBAAoJEO9KbElYeE3yjX4BAJ/ETNnlHn8OjZPT77xGmal9kbT1bC1 7DfrYVISWV2Y1AP9HdAMhWNAvtCtN2S1beYjNybuK6IzWYcFfeOV+OBWRDQ== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hello, On Thu, 2026-02-26 at 05:22 -1000, Tejun Heo wrote: > Hello, >=20 > On Thu, Feb 26, 2026 at 08:10:52AM +0100, Gabriele Monaco wrote: > > On Wed, 2026-02-25 at 07:08 -1000, Tejun Heo wrote: > > > On Wed, Feb 25, 2026 at 10:51:20AM +0100, Gabriele Monaco wrote: > > > > Export a task_is_scx_enabled() to allow quick classification by usi= ng > > > > the scx state SCX_TASK_ENABLED. > > >=20 > > > This test already exists - task_on_scx(). Please feel free to move th= at > > > out to include/linux/sched/ext.h. > >=20 > > I see task_on_scx() is used in what looks like some sched core hot path= s ( > > pick_next_task() -> prio_less()), but I presume not inlining it isn't a= big > > issue. >=20 > I mean, you can always export what task_on_scx() accesses. I'm not sure what the cleanest thing is here task_on_scx() is scx_enabled() && p->sched_class =3D=3D &ext_sched_class scx_enabled() might as well be exported (together with its static key), but= I'm not sure exporting the sched_class is the right thing, since all those sche= duler things are quite private. On the other hand, task_is_scx_enabled() (added in this patch) is scx_get_task_state(p) =3D=3D SCX_TASK_ENABLED and scx_get_task_state() is (p->scx.flags & SCX_TASK_STATE_MASK) >> SCX_TASK_STATE_SHIFT those are pretty much already exported. If those are really equivalent, wouldn't it be simpler to export scx_get_task_state() and use that in an exported (still inlined) version of task_on_scx() ? If you think exporting a sched_class is just fine I'd follow on with your suggestion without bothering, though. Thanks, Gabriele