Re: [PATCH] proc: faster /proc/*/status

From: Andi Kleen
Date: Sat Aug 06 2016 - 23:16:32 EST


Alexey Dobriyan <adobriyan@xxxxxxxxx> writes:
> -
> + seq_printf(m, "State:\t%s", get_task_state(p));
> +
> + seq_puts(m, "\nTgid:\t");

The only different should be the format string.

Scanning the format string really shouldn't be that expensive?!?

It would be better if you could find out why that is slow and optimize
it. Then you would benefit every seq_printf user, not just this
special case.

Perhaps it could benefit from some of the bit masking tricks to
scan the string with wider tests than a word.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only