Philip Blundell writes:
> pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long offset)
> {
>       pte_t *pte;
> 
>       pte = (pte_t *) get_small_page(GFP_KERNEL);
>       if (pmd_none(*pmd)) {
>               if (pte) {
>                       memzero(pte, PTRS_PER_PTE * BYTES_PER_PTR);
>                       set_pmd(pmd, mk_kernel_pmd(pte));
>                       return pte + offset;
>               }
>               set_pmd(pmd, mk_kernel_pmd(BAD_PAGETABLE));
>               return NULL;
>       }
>       free_small_page((unsigned long) pte);
>       if (pmd_bad(*pmd)) {
>               __bad_pmd_kernel(pmd);
>               return NULL;
>       }
>       return (pte_t *) pmd_page(*pmd) + offset;
> }
> 
> Can it happen that get_small_page() returns NULL owing to a memory shortage, 
> but we sleep anyway and somebody else fills in the pte in the meantime, in 

Yes, this is possible.

> which case we end up passing NULL back to free_small_page?  (I've been getting 
> complaints from that routine in my syslog from time to time.)

Correct.  I suppose free_small_page ought not to complain when this happens
(just accept but ignore it).  Ok, fixed.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [EMAIL PROTECTED]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]

Reply via email to