How much kernel stack can be used in non-terminal function inside module ?

Lev Olshvang <levonshe-zJpx2rpV7r/[email protected]> Thu, 16 Aug 2018 17:24:30 +0300
Newsgroups gmane.linux.region.israel
Message-ID <[email protected]>
Having the kernel stack is limited to 4K, how can I know how many of this 4K was used
before mu function X()  is called ?

I need to extract 512 bytes of some data from storage using vfs_getxattr().  I can call for kmalloc or just use buffer on stack.

But how can assess whether I can safely do this or not ?

What was the stack utilization till my function was called, how much space is left?

And while I may take a diff of SP and Stack segment register to know stack utilization to the current moment ( I wonder whether if there are some kernel macro exist?)  I do knot know how to calculate future consumption of stack memory down the vfs call chain.

Regards,
Lev
   

_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il