# Re: \[PATCH v2\] powerpc/powernv: Cache OPAL check\_token() results

- From: Shivang Upadhyay \<hidden\>
- Date: 2026-07-08 08:33:21 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2026/07/17229431
- Thread: https://ratatoskr.run/linuxppc-dev/2026/06/17180197/t.md

```text
On Tue, 2026-07-07 at 12:36 +0530, Nikhil Kumar Singh wrote:
> You can wrap the if (token_cache[token] == SUPP_UNKNOWN) check, as
> well as the if (token > OPAL_LAST) check above it, with unlikely(),
> since this function is in the hot path. Out-of-bounds tokens are very
> rare, and after the cache is populated, the SUPP_UNKNOWN condition is
> expected to be false in almost all cases. Wrapping these checks with
> unlikely() will help the compiler optimize branch 

Thanks for your suggestion, but Which hotpath code is calling this?
we can maybe change that hotpath to not do rtas calls.

~Shivang.
```
