From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E0B4ECAAA1 for ; Fri, 9 Sep 2022 23:08:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232141AbiIIXIF (ORCPT ); Fri, 9 Sep 2022 19:08:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231502AbiIIXGs (ORCPT ); Fri, 9 Sep 2022 19:06:48 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66673112B05 for ; Fri, 9 Sep 2022 16:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662764799; x=1694300799; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=J55eTet+/pIJBGUmidFc+Ug/avoVg22/mJRLCJ1cam4=; b=ME9YZxCK//c2TLvw8AJz1PLQdzgErrhejWqaUZO3p8R8soFVa77P62d6 7+TYR4NWSq4ClKVsV4QotQ5gCwQXrxAwWiTx9JGcJ2tmiMW+/w9SV9K4j 6f0qdGAPBs31ERkpz9aRmjEE0u97z7kb+6vSRaDRqEF5njq7EaB+TytnA LdXY92TM45Uhu/uLUdSMackcQjJfFvRXIx4ee1dXLuo+u224rxN05wQjX MgLeF8WyLtaxnp4pSf1OSxA6OcWs/nRavLVFh5uaIqSPM35cD5VoDaFCW QtOQToqIlYsEj5sbp0dsyyAD/nHz90KuNjUy3zJaEYkCtHZJngm9hq9SH g==; X-IronPort-AV: E=McAfee;i="6500,9779,10465"; a="298386922" X-IronPort-AV: E=Sophos;i="5.93,304,1654585200"; d="scan'208";a="298386922" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2022 16:06:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,304,1654585200"; d="scan'208";a="677355037" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by fmsmga008.fm.intel.com with ESMTP; 09 Sep 2022 16:06:35 -0700 From: Ricardo Neri To: "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot Cc: Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , Valentin Schneider , x86@kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri , "Tim C . Chen" Subject: [RFC PATCH 18/23] sched/task_struct: Add helpers for task classification Date: Fri, 9 Sep 2022 16:12:00 -0700 Message-Id: <20220909231205.14009-19-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220909231205.14009-1-ricardo.neri-calderon@linux.intel.com> References: <20220909231205.14009-1-ricardo.neri-calderon@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The unprocessed classification that hardware provides for a task may not be usable by the scheduler. The classification may change too frequently. An arch-specific implementation may want to consider other factors. For instance, Intel Thread Director considers the state of the SMT siblings of core. Provide per-task helper variables that architectures can use to post- process the classification that hardware provides. Cc: Ben Segall Cc: Daniel Bristot de Oliveira Cc: Dietmar Eggemann Cc: Len Brown Cc: Mel Gorman Cc: Rafael J. Wysocki Cc: Srinivas Pandruvada Cc: Steven Rostedt Cc: Tim C. Chen Cc: Valentin Schneider Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ricardo Neri --- signed char and unsigned char are both signed in riscv architecture. Use a signed char to avoid compilation warnings. --- include/linux/sched.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/sched.h b/include/linux/sched.h index 73f9e745d17d..6c8907622f00 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1517,6 +1517,16 @@ struct task_struct { #ifdef CONFIG_SCHED_TASK_CLASSES /* Class of task that the scheduler uses for task placement decisions */ short class; + /* + * A candidate classification that arch-specific implementations + * qualify for correctness. + */ + short class_candidate; + /* + * Counter to filter out transient the candidate classification + * of a task + */ + char class_debounce_counter; #endif /* -- 2.25.1