Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1879343pxb; Thu, 28 Oct 2021 11:46:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHiK8UEUSOfBcCM49q07r8PUVfEPbj1UiQsn0Oy/24QvBO/jqNTvR9lN/Xlxz1NlzfxIXZ X-Received: by 2002:a17:906:2ccf:: with SMTP id r15mr7430166ejr.182.1635446805069; Thu, 28 Oct 2021 11:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635446805; cv=none; d=google.com; s=arc-20160816; b=fc0CCH1bO1LwNxXQhakoLv0JhiDfe688n1ijTlm99Vgu04xJS54+p/QJkBcy2mlWpX CZI7nDpkDETUqbwzq6d5uTuVCeAEiosxijOiH8evJEOllhcpxrQOtncgQou9x08+E2Dg vapArfKOY+sN1zFzTtraFp8OndkwIxObJ5S22boR7ZfahiwdONMXbMv8GxJ/ngTUPZwZ AledLsK+mzwytZDI+It4fZuiOyi63WLAEwz6d1tCWOpBbi7u1CUijDR+P4tfITry2Yl8 DJfDE8So/UPTQiS/1KZXPxDOck/UC3/OU+CLvQ90hjb1KfRNSo1W3+gomksXuSEI8RcS YKvQ== 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=1zUy3F64VyvAN1yH0C1i8i1qWi6nPUFUYymxm3Q8UCc=; b=nU9pbSrmaifPxJOCCWqvcbEmOBPpTejWypXhmVFiHfkdd0srcI2qET5ARLIjErJ5Pm W1k5kMIbwGH/kRYYWG7aRp6QiJaK6cKxHoG4s4AzmeTN8MXzUcdq2wIs9T84eCvFwtYc Ai19cQnMMF2m6KJawtqIid0scCjvWeBNkIAoCfbHRJ5exRRgRJOpIwAhX8kkWMypSK4n 9c9aNnPf9mxLu3yOH7l+eEXmtyaFhwifcSuB7A8yyr3ZWGYZVIkjBoYpIoEuhURDOuDi r0YAE+69B2rR6KwPtgeok9VCSxCJXc2eJHzPHJhhevK0g/yUqpUxq3Qty33THTdaxIUY PSUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u2si4739132ejk.135.2021.10.28.11.46.20; Thu, 28 Oct 2021 11:46:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231175AbhJ1Spm (ORCPT + 99 others); Thu, 28 Oct 2021 14:45:42 -0400 Received: from mail-oo1-f43.google.com ([209.85.161.43]:45972 "EHLO mail-oo1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230293AbhJ1Spl (ORCPT ); Thu, 28 Oct 2021 14:45:41 -0400 Received: by mail-oo1-f43.google.com with SMTP id o26-20020a4abe9a000000b002b74bffdef0so2446840oop.12; Thu, 28 Oct 2021 11:43:14 -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=1zUy3F64VyvAN1yH0C1i8i1qWi6nPUFUYymxm3Q8UCc=; b=muN891ivavTsyZeO6+V66+b2PprDXhJonxSDrsnSgpoUJ5O2fXyXf8kq2L/AmjIdH7 MU8dIvZbWpz/5XD18cR+3XH6Ob4kI+2AIsWvyATPT/06zL6Auopq0h5eQJvhUSnLb/Yf JNYDb/DS4fKcDKVYCfi+Izp1wz8Y+Vb1YrP6OrqS0jJPkfaq0LNUJlv+8e4Z9nw0GXyR Zdt1PAOA+E3yP577+6sgAPQ1EQUXieJyq6KrfZma5MaxYKYv8E+M1Tp+qcbs8Rnr0akw RzmgETyN0lZMGuJk7ei2l3eL3olBMuLgzQO7A7QJyTviO7j0ZEkmBbZiNmIzfZ0eFkZ/ HCjw== X-Gm-Message-State: AOAM530s/LOD18PTtU9oL6oPDWwhwE7Or+pIcxeY0x5pTqdiVJTYP/CP 1+657TbJ8vWHbTno/YfA4J+IzQwA/+0aj5kIDNU= X-Received: by 2002:a05:6820:54e:: with SMTP id n14mr4336952ooj.89.1635446594349; Thu, 28 Oct 2021 11:43:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 28 Oct 2021 20:43:03 +0200 Message-ID: Subject: Re: problem in changing from active to passive mode To: Julia Lawall Cc: Doug Smythies , Srinivas Pandruvada , Len Brown , "Rafael J. Wysocki" , Viresh Kumar , Linux PM list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 28, 2021 at 8:16 PM Rafael J. Wysocki wrote: > > On Thu, Oct 28, 2021 at 7:57 PM Rafael J. Wysocki wrote: > > > > On Thu, Oct 28, 2021 at 7:29 PM Rafael J. Wysocki wrote: > > > > > > On Thu, Oct 28, 2021 at 7:10 PM Julia Lawall wrote: > > > > > > > > > Now, for your graph 3, are you saying this pseudo > > > > > code of the process is repeatable?: > > > > > > > > > > Power up the system, booting kernel 5.9 > > > > > switch to passive/schedutil. > > > > > wait X minutes for system to settle > > > > > do benchmark, result ~13 seconds > > > > > re-boot to kernel 5.15-RC > > > > > switch to passive/schedutil. > > > > > wait X minutes for system to settle > > > > > do benchmark, result ~40 seconds > > > > > re-boot to kernel 5.9 > > > > > switch to passive/schedutil. > > > > > wait X minutes for system to settle > > > > > do benchmark, result ~28 seconds > > > > > > > > In the first boot of 5.9, the des (desired?) field of the HWP_REQUEST > > > > register is 0 and in the second boot (after booting 5.15 and entering > > > > passive mode) it is 10. I don't know though if this is a bug or a > > > > feature... I think I didn't understand you correctly, sorry about that. In 5.15-rc (starting in 5.11-rc) the desired perf field in HWP_REQUEST is used in the passive mode, so that is expected. However, it may not be reset to 0 when going back from the passive to the active mode. > > > It looks like a bug. > > > > > > I think that the desired value is not cleared on driver exit which > > > should happen. Let me see if I can do a quick patch for that. > > > > Please check the behavior with the attached patch applied. > > Well, actually, the previous one won't do anything, because the > desired perf field is already cleared in this function before writing > the MSR, so please try the one attached to this message instead. So with the last patch applied, can you please check if you get desired=0 with 5.15-rc when switching driver modes from passive to active? FWIW, this works for me here. In any case, the desired perf value in HWP_REQUEST is expected to be reset to 0 on system restart.