On Wed, Jul 14, 2010 at 17:12 +0200, Michael Blizek wrote: > Hi! > > On 14:03 Wed 14 Jul , Kulikov Vasiliy wrote: > > Hi folks, > > > > I wonder whether any kernel code is swapped out in some cases? E.g. in > > windows NT kernel kernel code is divided into two parts - swappable and > > nonswappable, there is specific macros to mark the code being swappable. > > > > So, as I understand, all kernel code (including modules) and all > > static/global data is unswappable, all dynamic memory allocated with > > GFP_ATOMIC is unswappable, with GFP_KERNEL is swappable. Am I right? > > No, GFP_KERNEL is not swappable and I am not aware of any kernel memory which > is. This flag determines the behaviour when allocating memory: > > GFP_ATOMIC fail immediately, if no memory is available; This is needed is some > cases where the code cannot sleep (e.g. interrupt context) > > GFP_KERNEL put the code to sleep and try to free memory e.g. by swapping user > space memory to disk; However, this does not mean that allocations are always > successful either. Aha, undestand. In windows driver books it is said almost on every page - do not use swappable memory at IRQLs higher than IRQL of page fault handler. So, in linux the usage of memory is different, so I should try hard to catch page fault at nonpreemptive parts of kernel :) Thanks, now it is clear for me. -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ