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 3C457C433EF for ; Mon, 4 Apr 2022 21:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383169AbiDDVc6 (ORCPT ); Mon, 4 Apr 2022 17:32:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380145AbiDDTBd (ORCPT ); Mon, 4 Apr 2022 15:01:33 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 010C624598; Mon, 4 Apr 2022 11:59:36 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id n6-20020a17090a670600b001caa71a9c4aso227007pjj.1; Mon, 04 Apr 2022 11:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=oMVaKBgzoQqc7gxkYgb60MlXgXZZVMwR1kc99VQvjLA=; b=KLeLuThRs2MiFPARUNGy9/wBt8j9oC4NUv6OA1qkh3wwKwWqn1v2WyHaHbvNXtD81r hYeMB992L8FGwLeeJF1kmQQpQATlZpit/BeXgxxOM7Py4pf+9zG3UGbFG6RLkP/VbOGq Rf/m+hXlWg8JGM5Jh78VeO/JhNKm/mL2HaGt9eflIiQjLHgvYzqpI+3EwrASr1zzNsWR XjQ8MdY6p9tlCbundm5SciMoRUGjammmsPomk1CAqLqrX08sAU0fWqHUEVt4NoYtgG4m hcmR4RFRoEtQCNFGUZQUh6lGGfHEqcAy8WF70FfMglzOyQNApCqTtGhwpyCVCcagPntV 0s0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=oMVaKBgzoQqc7gxkYgb60MlXgXZZVMwR1kc99VQvjLA=; b=cFX0QwakqoWrTScEuIVaReSAvInGxNB2lW0JRRp4GhXRmNJFtp7bVh5DBzYUzXiZ3O rz/54rbMvRgkajXUo+RkbStUqjWyGBoJnro6mV+QQvsuuRhkqI0UDEsP3mUqCytD9kHk FmWxa/NBaIPtFYFyvDWjde6elXFIu3y9NeGqaJ8OI76EHVu5PnOGojJ7I93rFyv/mzyy ECYKcPUovUxF/gYuGUAUTK0KExYDxfyVZzkAqvKiKfMb7ewRXQu/NurYdWpDZ630x0Xw y7s9lOf3W+vV4ZbFPz2G7v0efcjM/J1+bxYBgsONjOrGoQ0Dx76EsUZ/QSHfq4WFw9Ic pHCA== X-Gm-Message-State: AOAM530vVsUpVJVDDzCEoc1ez/6IZcZH7Qst+TpN9ukv+B37t9p5rajU h8bpUUxNgbzlDUxjaJC+eks= X-Google-Smtp-Source: ABdhPJyoHAxIXDgPuzQYSYXmM0MUfvH0ZIPUhBbJtiYgDk4sxbS9KpnJ46j0O8SLg92GcaWMP+hUWw== X-Received: by 2002:a17:902:7245:b0:156:20aa:1534 with SMTP id c5-20020a170902724500b0015620aa1534mr1450307pll.94.1649098776500; Mon, 04 Apr 2022 11:59:36 -0700 (PDT) Received: from [192.168.66.3] (p912131-ipoe.ipoe.ocn.ne.jp. [153.243.13.130]) by smtp.gmail.com with ESMTPSA id f16-20020a056a001ad000b004fb358ffe86sm13116733pfv.137.2022.04.04.11.59.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Apr 2022 11:59:35 -0700 (PDT) Message-ID: <91357075-d8d0-fc0b-5264-4f5cfe368250@gmail.com> Date: Tue, 5 Apr 2022 03:59:30 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] Revert "ACPI: processor: idle: Only flush cache on entering C3" Content-Language: en-US To: "Rafael J. Wysocki" Cc: "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 References: <20220403062322.3168-1-akihiko.odaki@gmail.com> <4d6307d0-cd67-dfb2-6d6d-2f37bf4a271b@gmail.com> From: Akihiko Odaki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/04/05 3:56, Rafael J. Wysocki wrote: > 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 It looks good for me. Thanks, Akihiko Odaki