[LTP] [PATCH] read_all: limit sysfs tpm entries to single worker

Jan Stancek jstancek@redhat.com
Tue Oct 22 15:21:54 CEST 2024


On Tue, Oct 22, 2024 at 3:05 PM Li Wang <liwan@redhat.com> wrote:
>
>
>
> On Tue, Oct 22, 2024 at 5:45 PM Jan Stancek <jstancek@redhat.com> wrote:
>>
>> Repeated reads from TPM entries (tcg_operations, vs_operations,
>> caps,..) are causing big delays with 3 or more repetitions,
>> which has signs of some kind of rate-limitting on firmware side.
>>
>> This patch introduces a new kind of blacklist, which doesn't
>> completely skips the entry, but assigns it to only single
>> worker.
>
>
> Did you test that a single worker is faster enough with the
> default '.max_runtime = 100' on those kind of systems?

I did. It was only 3rd or 4th iteration that starts getting painfully slow.
It doesn't seem to matter if it's running parallel or sequentially.

For example, tcg_operations after certain point starts returning
"Blocked for OS by BIOS" (very slowly).

# time cat /sys/devices/pnp0/00:0a/tpm/tpm0/ppi/tcg_operations | grep Blocked

real    0m3.406s
user    0m0.000s
sys     0m3.631s

# time cat /sys/devices/pnp0/00:0a/tpm/tpm0/ppi/tcg_operations | grep
Blocked | wc -l
102

real    1m44.298s
user    0m0.000s
sys     1m45.316s


>
> If that's still timeout on the rate-limited files, what should we do (move to blacklist)?

Yes, I'd blacklist those where single read hangs for dozens of seconds.

>
> Anyway, the patch itself looks good to me.
> Reviewed-by: Li Wang <liwang@redhat.com>

Thanks for review.



More information about the ltp mailing list