> > I'm not sure if this is the right venue for this question.  Does anybody 
know
> > off-hand if kernel stacks are pageable?  
> 
> I don't think kernel stacks (for kernel threads or those supporting
> lwps) are pageable.  They are allocated from segkp (seg kernel pageable)
> but that is done with the SEGKP_LOCKED flag which stops them from
> being paged (I think).  (Working from mem sop names may be wrong)
> thread_create() calls segkp_cache_get for a new stack (if none is
> passed in); this function calls segkp_get_internal if none are available
> of the free list -and if you dig up how those free lists are defined they
> included SEGKP_LOCKED in their flags.

It's "KPD_LOCKED" but otherwise correct.

> 
> I'm sure Frank will correct me if that is wrong :-)  I've never fully
> comprehended the joys of segkp.

I'm sure someone will correct *me* on that if I'm wrong :)

"segkp" _used_ to mean "pageable" kernel memory but that's too
restrictive a meaning. In fact, <vm/seg_kp.h> says:

/*
 * segkp (as in kernel pageable) is a segment driver that supports allocation
 * of page-aligned variable size of vm resources.
 *
 * Each vm resource represents a page-aligned range of virtual addresses.
 * The caller may specify whether the resource should include a redzone,
 * be locked down, or be zero initialized.
 */

"kernel page-aligned". That's what "segkp" does.

Whether such a chunk is pageable or not depends on the request.
Passing KPD_LOCKED makes it unpageable. So kernel stacks are
unpageable. I'm not sure how long this has been true, though.

There surely would be some interesting (mis-)effects possible if
you'd be able to page kernel stacks, and such a stack had more
than one page (which is generally true today) ...

FrankH.

_______________________________________________
opensolaris-code mailing list
[email protected]
https://opensolaris.org:444/mailman/listinfo/opensolaris-code

Reply via email to