Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8612588rwr; Thu, 11 May 2023 04:01:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4lXfKGjN1FLstuet0/+qxNIDuf1+bHLrcXB40nnledBTGBtG/4NFUSjV4vhcjrGdF9nybU X-Received: by 2002:a05:6808:48a:b0:38b:8d27:ff52 with SMTP id z10-20020a056808048a00b0038b8d27ff52mr4517939oid.53.1683802877217; Thu, 11 May 2023 04:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683802877; cv=none; d=google.com; s=arc-20160816; b=Fi78jft+L+qt4UKgqvnGIM6CZn1fZ7QaYuqA4eUEP5245zHcK0oYuYBfgusPOwX5WD qy/4S1+jE4uGtsBYGzyYFy2HgUpFk2mEMChTDmqixkHlQdi08YZuN3lzGKyuX/48JQbG LToMDVxJoXzgFb6E/l1HP0lTetPKfMlJNozyP71Wonab7bYCvTN9NwSBp0jt882YuIr4 RWqv0FsvRLQM/GhtTb5hN3EMJRN8j5YUwcq0+/iwl6bi28/laItCoM+oSF+I1aIJr/8p +9+0pxwxGA/TQnSWfbOKA6wjhDf5gY6+LgP88yBPHZO9+knynyjQ9R+M1wvNqatWvfhM LmUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=ls1HuJB/1QTlaS9LaIOQRgWNz3JcWV535XzGBgbcdlA=; b=esVB4IlmeexMn7t019qRgLOSVIvaa2bbrSmJ1HC9sa4SR7nPZmVkmPYsy363f1dhzp iZZQhbL6V/vUDf97j/A7bgWRq+AjTqrrgYM5ETvXOGwbe+/96j9a5SpOACkwqs9bChgb UaL4tdRhOsUf8jiw7GsVo1Wm0g6GlkdF0ReGwEYx0OCFlxyQD3uqornP0gPdMKV/Eyfl cLPVXn/CTpC/VlWpKJd5Ldi/vynsN2Ikzwp8tcIGQFRUI4v+MrtMPifc0yC9LwtxBSVd mmfqEWH/QGqrsRqNuX03VhhrjoQARgv4FXoJiFejjz16oLgyeTMAmONZY1ZNhCSI/UOx c5Tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a9d4787000000b006ab06238c0dsi1218169otf.292.2023.05.11.04.01.03; Thu, 11 May 2023 04:01:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237736AbjEKKtI convert rfc822-to-8bit (ORCPT + 99 others); Thu, 11 May 2023 06:49:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237402AbjEKKtC (ORCPT ); Thu, 11 May 2023 06:49:02 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1894F5BA5 for ; Thu, 11 May 2023 03:48:41 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-202-iCHHTVxWNbqcZ3-yAECREg-1; Thu, 11 May 2023 11:48:39 +0100 X-MC-Unique: iCHHTVxWNbqcZ3-yAECREg-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 11 May 2023 11:48:37 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Thu, 11 May 2023 11:48:37 +0100 From: David Laight To: 'Tony Lindgren' , Geert Uytterhoeven CC: Stephen Boyd , Tomasz Figa , Sylwester Nawrocki , Will Deacon , Arnd Bergmann , Wolfram Sang , Dejin Zheng , Kai-Heng Feng , Nicholas Piggin , Heiko Carstens , Peter Zijlstra , Russell King , John Stultz , Thomas Gleixner , "Krzysztof Kozlowski" , Tero Kristo , "Ulf Hansson" , "Rafael J . Wysocki" , Vincent Guittot , "linux-arm-kernel@lists.infradead.org" , "linux-renesas-soc@vger.kernel.org" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v2 1/2] iopoll: Call cpu_relax() in busy loops Thread-Topic: [PATCH v2 1/2] iopoll: Call cpu_relax() in busy loops Thread-Index: AQHZg9SqgvUK/klkyEy9n2eMPFqMgK9U5DUg Date: Thu, 11 May 2023 10:48:37 +0000 Message-ID: <494a000774b546e4aae00ae0a7dfeae4@AcuMS.aculab.com> References: <20230511064839.GG14287@atomide.com> In-Reply-To: <20230511064839.GG14287@atomide.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,PDS_BAD_THREAD_QP_64, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tony Lindgren > Sent: 11 May 2023 07:49 > > * Geert Uytterhoeven [230510 13:23]: > > It is considered good practice to call cpu_relax() in busy loops, see > > Documentation/process/volatile-considered-harmful.rst. This can not > > only lower CPU power consumption or yield to a hyperthreaded twin > > processor, but also allows an architecture to mitigate hardware issues > > (e.g. ARM Erratum 754327 for Cortex-A9 prior to r2p0) in the > > architecture-specific cpu_relax() implementation. Don't you also need to call cond_resched() (at least some times). Otherwise the process can't be pre-empted and a RT process that last ran on that cpu will never be scheduled. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)