Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3507504pxb; Mon, 4 Apr 2022 19:12:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZOucQ8xjU//xejie2YWSLWEoobjmPg1xIDT22eBEVjfkAcRTF986ZTBfjYQH/DDcp9QAy X-Received: by 2002:a17:902:8a94:b0:156:1b99:f9d6 with SMTP id p20-20020a1709028a9400b001561b99f9d6mr1046521plo.49.1649124761420; Mon, 04 Apr 2022 19:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649124761; cv=none; d=google.com; s=arc-20160816; b=NMY1/o87Rtb/2GRFyIBdhcozTAL4urdElGWjVpO8n2DUd+2odzaKgTFJ0sIqLkJqSl VcNYzIyI7xr6UgG0x0chfMSU2xHm6wYABIS6UupoQ4GbgG5gvbj3GYMF/3MmrxphAoGU TtKlFSw8yOGsfSgJ6Mq6t8xZlj48gCC0U0wtZV6sMTxuzfXXgaYnc2luXWobVJjm0wGO 4GeEli2tWhrDrAGGHvNNF+ZodjlkcwXzsQyadRdhb7+WDyDn/WKCVjVKJmQI/7k0Y/0v xToyyBX0mZVX31AjuftiGAx6RSRxwAjhDTTjWwImZLFxRTuO4QwyA4Danxny71PLJdHN gjkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=myPVoCqtsI8E3yDzZq2k0LtGHfhc8/v0BCP25SPN5jA=; b=ficGTsFDnCIRvle4ONq6DtTcFet+oNjD2xKj1HerEit+4ci+iBjdwiW1VSq4pZYOb8 UXoVlkYGmFakhPlBrp6MyvqxbxuNuAlQ/0iPmqbVQho306BNPXFOL9M5c7kD6l7T9UUt ODHfeLkUL1w4JT9YUp3+vQ9n44/ga2n6s8iCHpac/9/6Dbrhcpa0vkA6CQDXAtcTu//S KNi5d23X9JnXsLt8Meu/ddLzA/o19W2cvLKfnYg5DvZoVWCyNYp29U8jKx2Nw9GuqI7V VZtPMYWwnfHGUhEMsf4yCJ0szLp9BEerSR7i3qERbMh5CJc6x+IAXhQwEo+i2HiaPclW EpGA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b198-20020a6334cf000000b003816043f011si11516855pga.518.2022.04.04.19.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 19:12:41 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2EF85267F84; Mon, 4 Apr 2022 17:35:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387017AbiDDVkD (ORCPT + 99 others); Mon, 4 Apr 2022 17:40:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380133AbiDDS7F (ORCPT ); Mon, 4 Apr 2022 14:59:05 -0400 Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F09C2C102; Mon, 4 Apr 2022 11:57:08 -0700 (PDT) Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-2eb3db5b172so64775667b3.6; Mon, 04 Apr 2022 11:57:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=myPVoCqtsI8E3yDzZq2k0LtGHfhc8/v0BCP25SPN5jA=; b=XW0pudLE5S2mdxsLuQTQkMiyisnc41yFjaiOin5vouIvDeAkmE+sxM/qIm+NkNzWxX 5ItOOhahtGXd4AqNewIZBMd75ZAdkIQBBy9OjUVkgoBecIv0tAJ4+svu9G8eKyE/FwPR KWDRe1grbORoPDGxDje7Bnw7ZrrI1yAgzvqRFFesTzUMisKnWCEf7G146QtTCo9PVwfq lg1h4uJ5WSFlotdXUQL6uDl/SpAMPvyO1jEdhglJcQ7xDo7pyP8LF8GdgoPDWxJ1KtUK EabcANBEkblQnUSsnHWOdiEfTIUcVA1N1wN5lgECe9L8fwuL5XHFMiFIjxnUbAnDO1LC zCAQ== X-Gm-Message-State: AOAM532/rsRWx7nxoUuWlFmVZcLQTM27o40Mh0p/2tT0SI6O4O+wq1EW 7qrV4m3elf1NqqRJQfqWHwNmeUfuiI8nffLxi7w+vQvlOWU= X-Received: by 2002:a81:1b97:0:b0:2db:640f:49d8 with SMTP id b145-20020a811b97000000b002db640f49d8mr1309564ywb.326.1649098627877; Mon, 04 Apr 2022 11:57:07 -0700 (PDT) MIME-Version: 1.0 References: <20220403062322.3168-1-akihiko.odaki@gmail.com> <4d6307d0-cd67-dfb2-6d6d-2f37bf4a271b@gmail.com> In-Reply-To: <4d6307d0-cd67-dfb2-6d6d-2f37bf4a271b@gmail.com> From: "Rafael J. Wysocki" Date: Mon, 4 Apr 2022 20:56:56 +0200 Message-ID: Subject: Re: [PATCH] Revert "ACPI: processor: idle: Only flush cache on entering C3" To: Akihiko Odaki Cc: "Rafael J. Wysocki" , "Kirill A . Shutemov" , "Rafael J . Wysocki" , Andi Kleen , Borislav Petkov , Dan Williams , Dave Hansen , "H. Peter Anvin" , Kuppuswamy Sathyanarayanan , ACPI Devel Maling List , Linux Kernel Mailing List , Ingo Molnar , "Rafael J. Wysocki" , Kuppuswamy Sathyanarayanan , Thomas Gleixner , Tony Luck , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,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 On Mon, Apr 4, 2022 at 8:25 PM Akihiko Odaki wrote: > > On 2022/04/05 3:13, Rafael J. Wysocki wrote: > > On Sun, Apr 3, 2022 at 8:25 AM Akihiko Odaki wrote: > >> > >> This reverts commit 87ebbb8c612b1214f227ebb8f25442c6d163e802. > >> > >> ACPI processor power states can be transitioned in two distinct > >> situations: 1. when CPU goes idle and 2. before CPU goes offline > >> ("playing dead") to suspend or hibernate. Case 1 is handled by > >> acpi_idle_enter or acpi_idle_enter_s2idle. Case 2 is handled by > >> acpi_idle_play_dead. > >> > >> It is necessary to flush CPU caches in case 2 even if it is not > >> required to transit ACPI processor power states as CPU will go > >> offline soon. However, the reverted commit incorrectly removed CPU > >> cache flushing in such a condition. > > > > I think what you mean is that the CPU cache must always be flushed in > > acpi_idle_play_dead(), regardless of the target C-state that is going > > to be requested, because this is likely to be part of a CPU offline > > procedure or preparation for entering a system-wide sleep state and > > the stale cache contents may lead to problems going forward, for > > example when the CPU is taken back online. > > > > If so, I will put the above information into the patch changelog. > > I guess it is causing problems because the dirty caches will not get > written back and the RAM becomes stale if they are not flushed. From my > understanding, the CPU should have an empty cache and read back contents > from RAM when it is taken back online. OK, please see if the changelog I've added to the patch is looking good: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=dfbba2518aac4204203b0697a894d3b2f80134d3