Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp337719lqs; Thu, 13 Jun 2024 11:24:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJToyzRaxlyZWhMAnw1NQhzuZN9dp0VvismGoimld3dWYPrmsao44uITjySMobdWksD+0e5+O+yA+BHcSm/9zsqnAkvN58ApZlwgCh9A== X-Google-Smtp-Source: AGHT+IGEKRGfTRGrPBDO+RJjGQEGIHSH24r2yusCy5rZhL7TduvolA4QqryzxzOn12iz/RFeRmuG X-Received: by 2002:a05:6a21:19f:b0:1b4:da55:e1be with SMTP id adf61e73a8af0-1bae7dd432cmr867700637.14.1718303065175; Thu, 13 Jun 2024 11:24:25 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fedd4f439csi1812016a12.48.2024.06.13.11.24.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 11:24:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="D/KjMiz1"; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-213820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213820-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 84A51B21D2C for ; Thu, 13 Jun 2024 18:22:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80F5E14B094; Thu, 13 Jun 2024 18:21:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="D/KjMiz1" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2079.outbound.protection.outlook.com [40.107.244.79]) (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 D32B014A600; Thu, 13 Jun 2024 18:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.79 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718302890; cv=fail; b=dat/XltuYyY6/yyBUeCBSp6ZI7IgiuF6/sEayoQEopbdTJ12yYQL9EJdhb4tjpSaRF7BCNgxt9UBjZ79Hg5tDoJxAKYgGUyVaPvjn0Zdr2qo//X5Rlb3zQc4Jshv6w6uPmnhjygI/ZEv0G05AbrQqcjSCsS6LLYJDNLhupO7DCI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718302890; c=relaxed/simple; bh=p0cKsEkbsM+vF8/wgff97JNOl/JpHboL4oasYrYew2s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Lkcn/NQmNb1+EDbjUQ59wzGoFh+OK7hm45TLf1S7/pW3Ka4IJOelddh0bLMmM93S0YCXwgg8/HsZjqfFTL3QiOrm8DpnAETQjR1NMRP/mXIijrsPW3yP7pRq2EUQA14hVqteLJ4DCzACSWrJCbPDnPQ6xmLkk+cqf/3PjF7aD6s= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=D/KjMiz1; arc=fail smtp.client-ip=40.107.244.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nnFIgEyAvLKuyzfjzuDNouN2YpFoP3LYlmYYvSCtLz7luFNmZHUKJXANUrwATyI8K8uvDqyKYOnr86RwbrmzsiIRy5hW2KmyC3ZPVXqNRygL7gLM+HiyYtA5ocILSQj2sydMFHEQUCw+aWhVXzBjSixQXQh5gb+GHk//regn7xsjqJpKj2vMSnkLrcL84IURqijU4ePRyi7fE1T+gIYzdj0k42Bpjdf/aWZDIGH48+gt6a/Y0mNHNTRMinp59VkMO7ptuheg4QeeFFVJD2vCJYzIoaf3ailUC90Xecz69CINWVZScg4foZ+uSCjSgvLQsZ0aZxaVKBNh6V0gnP0cUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7bZVytII8R+C/v+PKo5wVvTus0SddPbaB1Zkfd2yfPY=; b=FgJh/4jKWf+oenoFYIN3dKoM+gQ/AEQPD/mcE9kZk/yEQOD8f39YlbCVXwKugLBZ9nYJA4fDeHG8BFwFdFOkX4Z283BjGPoZaMYHgH9vtXCLaNewl7NNZW3gCpOMMwW2we6X2XkNR/pP6i8P2EpC35n72cBWAU/nuJovDug0O3JhahNIUiDNEPnmF4JQ0AURKY0DscFPlqtBBuFBWGYjvVIycQe5P87/+wSvgVYGWCL1Ol35OC4WUI5LrO6Eoq7Uc/SREYMkU2LBx9rUJf+b+tHeRbfz8JR/6h8MUOwH9fuq/FQOjfpeydfT636Rj56TBduyKppIGTC92f2z5DotLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7bZVytII8R+C/v+PKo5wVvTus0SddPbaB1Zkfd2yfPY=; b=D/KjMiz1YfOPD9duGajzB8GVoGiYev5C+/JGnu/oD7XmWTuxOCQfVTWo6B//Fu7NIbIrijhh2Vz/oO+/6MEjed0pK2cwQCdyFxsLd7M6AhlmExQhlSBWr9jKCk5sCs/ONZv2Vd9EfAwXmqf2OrwEMGXYYw3HAZp5ZiiS8sELoUM= Received: from MN2PR06CA0024.namprd06.prod.outlook.com (2603:10b6:208:23d::29) by PH8PR12MB7182.namprd12.prod.outlook.com (2603:10b6:510:229::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20; Thu, 13 Jun 2024 18:21:25 +0000 Received: from BL6PEPF00022573.namprd02.prod.outlook.com (2603:10b6:208:23d:cafe::41) by MN2PR06CA0024.outlook.office365.com (2603:10b6:208:23d::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20 via Frontend Transport; Thu, 13 Jun 2024 18:21:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF00022573.mail.protection.outlook.com (10.167.249.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 18:21:25 +0000 Received: from BLRKPRNAYAK.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 13 Jun 2024 13:21:17 -0500 From: K Prateek Nayak To: CC: "Gautham R. Shenoy" , K Prateek Nayak , "David S. Miller" , "Andreas Larsson" , "Rafael J. Wysocki" , Daniel Lezcano , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , "Daniel Bristot de Oliveira" , Valentin Schneider , , Subject: [PATCH v2 10/14] sparc/thread_info: Introduce TIF_NOTIFY_IPI flag Date: Thu, 13 Jun 2024 18:16:09 +0000 Message-ID: <20240613181613.4329-11-kprateek.nayak@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240613181613.4329-1-kprateek.nayak@amd.com> References: <20240613181613.4329-1-kprateek.nayak@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00022573:EE_|PH8PR12MB7182:EE_ X-MS-Office365-Filtering-Correlation-Id: af9bb6d8-ab9a-48ae-d809-08dc8bd5a2c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230035|376009|7416009|1800799019|36860700008|82310400021; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?KjnFamwtsOv0+kkIeS4C2HyEk7bDBEgS1oRMGmIgWPeyWauDQbqcd0fOtn2y?= =?us-ascii?Q?lnmEsnjfMGAuK6Hd0bsCrKvMt9iFaY9WrhYpzP5d/DVj45/dNi5xR59LgAc1?= =?us-ascii?Q?RMF/F+j7Ifv2v2Mh3zNbDn+0mtyGlZ4Sn4eOGPlbN3RxFzdY+8+PnqX28gJc?= =?us-ascii?Q?mi5y9slGNPHdnJUwZIHIKk4rJPMYrl9+u4mOuxKxwfHQkoh5b1x10JON9c+k?= =?us-ascii?Q?3lSmIQH5KoIUJAFuArTkAeIf4NGxEjtU7wdXEw+R5qjVAPtzT/JCcGWE9XUs?= =?us-ascii?Q?f6HMWmvDqEOyo2R2SfzwMZ+jCX7joIsR90oeTn+e9OALuydnq2J626QINVtA?= =?us-ascii?Q?zSbAsN8iZDmh73KW31lDN22TN1aZ7Lhj5CjdEI3gl/oVbXJqLoCL0xsHDtHL?= =?us-ascii?Q?K3e+I2SzwbeXdJiIEm/y2yhSRVtbGlYskZ60hH05VlN7ttV5bvMc+faIWcsR?= =?us-ascii?Q?aXA88s7rLRSO+06x7pO5Ixma3qXL8aHmuEnCXpXzlc0U3yYr+6BJARtcBqnl?= =?us-ascii?Q?VIuGreDaIL6kEVenWv0+lcYYJao/aKJyfOQsBdFMPNmmqF6hg99o/PPgcDT+?= =?us-ascii?Q?A78v3jMRzcO+oolUem5O/P7cEbw6AwS1MaIscLNb/WrEQnDv56i9d2zhajIo?= =?us-ascii?Q?WvNy0YeYsfufVhTSX2O8z9ZYWr0GBaYWFUY8coPfGm9VQ1uzH7hg5O/4OjF9?= =?us-ascii?Q?fAx0uI6c5kpMim8nP4XMDLvrCKit1L996ONDJh+AnZoZpU7VPP3BDb0S3tgA?= =?us-ascii?Q?v2mjcYcoUr0Q3vx/ZftlJreflsHphY513o2/tcUrzr80hGlYYhYUKxyIu9P7?= =?us-ascii?Q?V0/bjuJWumqw6LwKjeLqZqEnn+HqiprtvQvZzzy7I+cY56wdr4WeFhMG1xmn?= =?us-ascii?Q?rVnH5bNwAYwBG87sQD6gjtM/ekfPRUb62/jzkE3oIASzNuliYFqdHB0wamok?= =?us-ascii?Q?9i+TIoilLoUBcYBufK/DDiX0gQqdYepTCwSvXowUs2Ejhg1Adt1tMIAL6Wzv?= =?us-ascii?Q?og3zrSh13McP5CenIoQjbTH/GQl0SJ2SP64MVzArXlrFpvIHsZXNFFtvCczQ?= =?us-ascii?Q?nV0Pb7/4MxzZJiuoW69EZwGuq3U6Lw8v/wtpe4rDXJlkpcqaDk/38TQply9c?= =?us-ascii?Q?TGAJYIUpvSP2S+gT6EtcS68AaEKFu01yUoRIuBPJoyGMWbclKU+0GP4d0YNC?= =?us-ascii?Q?Pvj9hm0LFney1V3IEr+irRYYQC+qXGjytCnICxeV0qmu18DMKH/0+Locx8e6?= =?us-ascii?Q?h3T7i+gMSbU5cXEx3IDrIesk1p0PE5aKzvQnRcDMAl3rw2zjIeN1HNgD7dIB?= =?us-ascii?Q?OctH0LlHwzD56SPk3CB50fHWDdgvyg5bABFZHoinfDXjcjEAZOAyJChNgsJp?= =?us-ascii?Q?c3Kcd6M6fUPhZVxZOmPth6JYwcybfQKKlZo8vhOawcrLpUUShA=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230035)(376009)(7416009)(1800799019)(36860700008)(82310400021);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 18:21:25.2856 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af9bb6d8-ab9a-48ae-d809-08dc8bd5a2c9 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00022573.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7182 Add support for TIF_NOTIFY_IPI on SPARC. With TIF_NOTIFY_IPI, a sender sending an IPI to an idle CPU in TIF_POLLING mode will set the TIF_NOTIFY_IPI flag in the target's idle tasks's thread_info to pull the CPU out of idle, as opposed to setting TIF_NEED_RESCHED previously. This avoids spurious calls to schedule_idle() in cases where an IPI does not necessarily wake up a task on the idle CPU. Cc: "David S. Miller" Cc: Andreas Larsson Cc: "Rafael J. Wysocki" Cc: Daniel Lezcano Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Steven Rostedt Cc: Ben Segall Cc: Mel Gorman Cc: Daniel Bristot de Oliveira Cc: Valentin Schneider Cc: K Prateek Nayak Cc: sparclinux@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org Signed-off-by: K Prateek Nayak --- v1..v2: o No changes. --- arch/sparc/include/asm/thread_info_32.h | 2 ++ arch/sparc/include/asm/thread_info_64.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h index 45b4955b253f..f538ede526d1 100644 --- a/arch/sparc/include/asm/thread_info_32.h +++ b/arch/sparc/include/asm/thread_info_32.h @@ -105,6 +105,7 @@ register struct thread_info *current_thread_info_reg asm("g6"); #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ #define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */ #define TIF_NOTIFY_SIGNAL 5 /* signal notifications exist */ +#define TIF_NOTIFY_IPI 6 /* Pending IPI on TIF_POLLLING idle CPU */ #define TIF_USEDFPU 8 /* FPU was used by this task * this quantum (SMP) */ #define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling @@ -117,6 +118,7 @@ register struct thread_info *current_thread_info_reg asm("g6"); #define _TIF_SIGPENDING (1<