From: "Moger, Babu" <bmoger@amd.com>
To: Borislav Petkov <bp@alien8.de>, Babu Moger <babu.moger@amd.com>
Cc: tony.luck@intel.com, reinette.chatre@intel.com,
Dave.Martin@arm.com, james.morse@arm.com, tglx@linutronix.de,
mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org,
hpa@zytor.com, linux-kernel@vger.kernel.org,
peternewman@google.com, eranian@google.com,
gautham.shenoy@amd.com
Subject: Re: [PATCH v3] x86/resctrl: Fix miscount of bandwidth event when reactivating previously Unavailable RMID
Date: Thu, 9 Oct 2025 20:57:02 -0500 [thread overview]
Message-ID: <277298e3-5713-4914-848b-9644f33e2a30@amd.com> (raw)
In-Reply-To: <20251009232200.GDaOhDmBfQVJOQjETG@fat_crate.local>
Hi Boris,
On 10/9/2025 6:22 PM, Borislav Petkov wrote:
> On Thu, Oct 09, 2025 at 01:29:17PM -0500, Babu Moger wrote:
>> - *val = get_corrected_val(r, d, rmid, eventid, msr_val);
>> + switch (ret) {
>> + case 0:
>> + *val = get_corrected_val(r, d, rmid, eventid, msr_val);
>> + break;
>> + case -EINVAL:
>> + am = get_arch_mbm_state(hw_dom, rmid, eventid);
>> + if (am)
>> + am->prev_msr = 0;
>> + break;
>> + default:
>> + break;
>> + }
>
> What's the point of this switch-case?
>
> Why is this not better?
>
> if (!ret)
> ...
> else if (ret == -EINVAL)
> ...
>
>
> return ret;
>
Yes. This should work. Will revise the patch for v4.
thanks
Babu
next prev parent reply other threads:[~2025-10-10 1:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 18:29 Babu Moger
2025-10-09 23:22 ` Borislav Petkov
2025-10-10 1:57 ` Moger, Babu [this message]
2025-10-10 4:19 ` Reinette Chatre
2025-10-10 16:52 ` Moger, Babu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=277298e3-5713-4914-848b-9644f33e2a30@amd.com \
--to=bmoger@amd.com \
--cc=Dave.Martin@arm.com \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=eranian@google.com \
--cc=gautham.shenoy@amd.com \
--cc=hpa@zytor.com \
--cc=james.morse@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peternewman@google.com \
--cc=reinette.chatre@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®