From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1FB43431FC for ; Wed, 25 Oct 2023 15:34:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E74C9427E1; Wed, 25 Oct 2023 15:34:35 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 81168402D0; Wed, 25 Oct 2023 15:34:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698240874; x=1729776874; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=JxNBfjd1qBbCcR3Cg9kRAPDCkIWSmakSq7oYCAt/DOw=; b=WAh4QadDZOy6VpUrwUexhBg43SRaA2m6z3k8dz+W4Sux5M5g7XX6utUr i5z3AazBhOuGmSGDZSukrv+1GIWSwd5up7alZurRMXs+lchPiZ/L6nW1u 6ue66CGieCGin02pAF5YcIGb/UT52XI1O/IDd6fqwpM8t3Rrr7Wq6RREu 7k7UMTLPHMcbXMpDUT74eyzWD1NozXEjs9Apvwt1tTkRq/T8fXNTXd9Qu U+0vYNvlK8AA+nBcVwzLVu043UCeOlyBfBuwXGAw2Yo/ZcLIvu7l4H43H xyg6Ae6z67nIEPt99tHG53Ngf1KDiw/qoqsB3DLVwgC6TQHmGu4Vv3LZS Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="5921949" X-IronPort-AV: E=Sophos;i="6.03,250,1694761200"; d="scan'208";a="5921949" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2023 06:34:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="752328159" X-IronPort-AV: E=Sophos;i="6.03,250,1694761200"; d="scan'208";a="752328159" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 25 Oct 2023 06:34:20 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 25 Oct 2023 06:34:19 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Wed, 25 Oct 2023 06:34:19 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.40) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Wed, 25 Oct 2023 06:34:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=daLLaM6ThGMp1NltlmBgpNXzvlId/NpLqK6+mtFvgldPWl2SqfVCmLh4XdvIFLDOAa2kdAhvja0syo4SoypfhC3n5QywsUQSJOj2sm36VjRpdYrlG4F5HNB1IAJ/8qS/GdElgOiseU66GisV/mksvObKymzOe4yD39N4oIT6hesIyPO0yOQmUePCW8LUGTbHU0RhROWhRzbQiKr/0WdGT/61rv8knWbMSi36aJnBWXjrr06YpbaOmzRE1WAEy8Nf3MFLHI0y5OtGEspkaX2sePVCzmCaHK90TZmZkl9j7Lg9w47kXZwqWJNbhtbZghnNyme5nx2cGnbJwJXHWdS6jw== 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=BhMtFimD6mSnu8cn2pSGg1YFvlGXIGsbBns2lsam3Gc=; b=WLYLTB87vM/JZHecRziikQZDpkOFaX890SenF5FzGYgmqvFsfvUV0/RZmh7Sbt03bj7tUUnaBbRU76mh1KTMu5oLaub1pq4lM+xpAKaOsxEYfzgHsRRODm13tXFZA2iraAfEFBBM5R2KlLxxMlrN8U/yt5DbgsQWe6GYf+tkvsTVDpWakGQIsC2xPz2+BTbwHYUNszuRALQjlKO23MK62zNZJKUwmsoFjewW/XsyZL5bBrOEc5pMOc1cqv5GLMlCZl0zeYLwZE3ekD+6N6DPolH9rplZfz78/p55pBiQu4f/gEKMRFFSdTu+LXLMKHeO53RTgTObcRFZaND+vPn47A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by BN9PR11MB5339.namprd11.prod.outlook.com (2603:10b6:408:118::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.19; Wed, 25 Oct 2023 13:34:14 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::d70b:11a0:d28f:ec44]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::d70b:11a0:d28f:ec44%6]) with mapi id 15.20.6907.032; Wed, 25 Oct 2023 13:34:13 +0000 Date: Wed, 25 Oct 2023 14:34:08 +0100 From: Bruce Richardson To: Thomas Monjalon CC: Morten =?iso-8859-1?Q?Br=F8rup?= , "Stephen Hemminger" , Min Zhou , , , David Marchand , Anatoly Burakov , Narcisa Vasile , Tyler Retzlaff , Dmitry Kozlyuk , Konstantin Ananyev , Andrew Rybchenko Subject: Re: [PATCH] eal/unix: allow creating thread with real-time priority Message-ID: References: <20231024125416.798897-1-thomas@monjalon.net> <98CBD80474FA8B44BF855DF32C47DC35E9EF75@smartserver.smartshare.dk> <20231024090450.519ac82b@hermes.local> <3767229.kQq0lBPeGt@thomas> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3767229.kQq0lBPeGt@thomas> X-ClientProxiedBy: DUZP191CA0019.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f9::29) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|BN9PR11MB5339:EE_ X-MS-Office365-Filtering-Correlation-Id: ff2b7114-2d91-4df1-a668-08dbd55f13ad X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r2hF0PNTtA2y2QTvl4O+/Hl9Be3sGzyEIin/MR6doJgUMEOFmRHJb8T+LHmpszYgwE6FXBygqXzE35NnntAdARBhehQAmROHq8KuyToFYxaczqkTxSy6JaExFKuzFRjC1w1kfMjPwdOTbkA7/DxX7PHjQ64xAy/Q+T5O2BWRqfWhXNvMSu7d+tbY4cLJYDxnafZ23SbdPTglBItPxLSum9BeXXrSEqs7CCbmJE7Dg1du8UHQebT93UBH01Yh7nvGEeHnvf1bcL/vGVx40o2ClXdreRGLmQVumCKwzMHyDuj0ndptM7W4Hwj9QnV/rey8kzXKZ1efpLLUwmAordwdbBonPqp5UIROF8VGrh67IoXygog/zbo53TiK6JeVjCwgi/GD8Nnswvf+v1ZbnkFyMpDxuyk6rr0ZZZBsKHImteE8RHH11Ch2O9ofrk1rNott2o+uhXpVcng2ctW3QX9OUqnei6BI9YWJyO2l9DzTwK75BfYZdd97/Jg/NdxddKdqqWev0XjuEVeWrZo0khpTPH06oumw9xrAl1LdGM5jnfM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(366004)(39860400002)(136003)(396003)(346002)(230922051799003)(64100799003)(1800799009)(451199024)(186009)(26005)(478600001)(6512007)(6666004)(86362001)(6506007)(316002)(6916009)(54906003)(66476007)(66946007)(66556008)(38100700002)(66574015)(966005)(6486002)(2906002)(8676002)(83380400001)(7416002)(4326008)(8936002)(44832011)(82960400001)(5660300002)(41300700001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?Py2ZYzvlrcVTl2WgDls8pKv1K1qwHMnQBqh0wON+WbQTfV5hs2VggQVcBb?= =?iso-8859-1?Q?BFvv9ErxHyZgaTaCnAi2vPTXqUduHFKNhl3vBlGNETuwRltc5wN9lLi/5u?= =?iso-8859-1?Q?uIXBVGErIeVCrDXf/yHdIYJYHMsMRkejyWTCGHcXXxqoNOpy24LfbWWbjT?= =?iso-8859-1?Q?6EkOY1kpcHA7eRYObZNMIgRi+N6o8+R2oC1cMC+FOdiH695V12CYTtvkFg?= =?iso-8859-1?Q?nqb2DzeB5Z3MPmrzBj+qxt8uiXH2cPl+zMh43hBrj7ZQ4E2HZGwCeERuB7?= =?iso-8859-1?Q?VcqeTsVevqcb1IR3jx5rT3CXharje78BuJrxRpgQuFVhkzlAMzHZVthwBv?= =?iso-8859-1?Q?5KgV3bmAWU77vTkQWW55TFDvdWZn7ofIMZv61pEY54CTt5u+keTZY1dJUq?= =?iso-8859-1?Q?p62pqRMnKa6e4ZgFIiFGEohK2ULr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Q?JR31RAtkGXAVvKvU0kl6/xFbVlmnGfvLHY+tt/fsQPChxPH9NJJT3q7VRj?= =?iso-8859-1?Q?Xb3Ep5PBa44ktnge4xYkGqnY7+kxk30UqHwMAwpX7Om/ULsYZYeJhAJ4+Y?= =?iso-8859-1?Q?8471X2tNPb/JBfr2EciVn/511Jtu7p43LeToUofNBA3j3QFF12AtphDKWu?= =?iso-8859-1?Q?bVeIpujpXrHrUGao0PxzlXjtlDdy3zhgJXnTNsy5R5LzyO96zhdN0rOZXW?= =?iso-8859-1?Q?HfjPfu3+MvYYBYrOBIGq/DkhBk8bAe6Yp8LHxLiLQ5d9lazrPHtqvjBU6x?= =?iso-8859-1?Q?+4xK7IzuiRYH4X6Apxe8P+2iACMutuY1PCDQJDk7oUU1olQCHsbublew?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: ff2b7114-2d91-4df1-a668-08dbd55f13ad X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2023 13:34:13.4018 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tNAhCqQsfOs96E0/yzmCpzGEJXArhMs3688e8v+4vZCJBhjTM6LrmzxF5XCENaJgAOW5eGyCcQ2rbQB4If0QpeJODST+X08BL/tipMgnMVk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5339 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Wed, Oct 25, 2023 at 03:15:49PM +0200, Thomas Monjalon wrote: > 24/10/2023 18:04, Stephen Hemminger: > > On Tue, 24 Oct 2023 15:55:13 +0200 > > Morten Brørup wrote: > > > > > > > > > > 4. It MAY be used by preemptible multi-producer and/or preemptible multi- > > > > consumer pthreads whose scheduling policy are all SCHED_OTHER(cfs), SCHED_IDLE > > > > or SCHED_BATCH. User SHOULD be aware of the performance penalty before using > > > > it. > > > > > > > > - 5. It MUST not be used by multi-producer/consumer pthreads, whose > > > > scheduling policies are SCHED_FIFO or SCHED_RR. > > > > + 5. It MUST not be used by multi-producer/consumer pthreads > > > > + whose scheduling policies are ``SCHED_FIFO`` > > > > + or ``SCHED_RR`` (``RTE_THREAD_PRIORITY_REALTIME_CRITICAL``). > > > > > > Do the RTS or HTS ring modes make any difference here? > > > > > > Anyway, I agree that real-time priority should not be forbidden on Unix. > > > > > > Acked-by: Morten Brørup > > > > Please add a big warning message in the rte_thread.c and the documentation > > to describe the problem. Need to have the "you have been warned" action. > > Yes I can add more warnings. > > > Use of RT priority is incompatible with 100% poll mode as is typically done > > in DPDK applications. A real time thread has higher priority than other necessary > > kernel threads on the same CPU. Therefore if the RT thread never sleeps, critical > > system actions such as delayed writes, network packet processing and timer updates > > will not happen which makes the system unstable. > > Yes, and it is shown by the test on loongarch: > DPDK:fast-tests / threads_autotest TIMEOUT 80.01s > http://mails.dpdk.org/archives/test-report/2023-October/488760.html > > I'll try to pass the test by adding a sleep in the test thread. > "sched_yield()" rather than sleep perhaps? Might better convey the intention of the call.