lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 30 May 2024 20:14:17 -0400
From: Pasha Tatashin <pasha.tatashin@...een.com>
To: Shakeel Butt <shakeel.butt@...ux.dev>
Cc: akpm@...ux-foundation.org, jpoimboe@...nel.org, kent.overstreet@...ux.dev, 
	peterz@...radead.org, nphamcs@...il.com, cerasuolodomenico@...il.com, 
	surenb@...gle.com, lizhijian@...itsu.com, willy@...radead.org, vbabka@...e.cz, 
	ziy@...dia.com, linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v3] vmstat: Kernel stack usage histogram

Hi Shakeel,

> Couple of questions:
>
> 1. In future with your on-demand kstack allocation feature, will these
> metrics still be useful? (I think so but I want to know your take)

It depends on how on-demand allocation is implemented. On hardware
that supports faults on kernel stacks, we will have other metrics that
show the total number of pages allocated for stacks. On hardware where
faults are not supported, we will most likely have some optimization
where only some threads are extended, and for those, these metrics
will still be very useful.

> 2. With on-demand kstack allocation, the stack_not_used() needs to be
> changed to not cause the allocation, right?

This is correct, in my WIP dynamic kernel tasks RFCv2 patch series, I
have an optimized version of stack_not_used() that uses the number of
allocated pages in the partially filled vmap to determine the last
stack address.

> 3. Does the histogram get updated on exit only? What about long running
> kernel threads whose will never exit?

Yes, for performance reasons, the histogram is updated only on exit.
It would be too expensive to calculate for all running tasks. However,
it could be extended to be queried on demand via a debugfs interface
for all running threads. On machines where jobs come and go over time,
this histogram will show the actual stack usage distribution.

Thank you,
Pasha

> thanks,
> Shakeel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ