get_user_pages() still broken in 2.6

From: Timur Tabi (timur.tabi_at_ammasso.com)
Date: 09/29/04

  • Next message: Paul Fulghum: "Re: Serial driver hangs"
    Date:	Tue, 28 Sep 2004 17:40:26 -0500
    To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernelnewbies@nl.linux.org
    
    

    I was hoping that this bug would be fixed in the 2.6 kernels, but
    apparently it hasn't been.

    Function get_user_pages() is supposed to lock user memory. However,
    under extreme memory constraints, the kernel will swap out the "locked"
    memory.

    I have a test app which does this:

    1) Calls our driver, which issues a get_user_pages() call for one page.
    2) Calls our driver again to get the physical address of that page (the
    driver uses pgd/pmd/pte_offset).
    3) Tries allocate 1GB of memory (this system has 1GB of physical RAM).
    4) Tries to get the physical address again.

    In step 4, the physical address is usually zero, which means either
    pgd_offset or pmd_offset failed. This indicates the page was swapped out.

    I don't understand how this bug can continue to exist after all this
    time. get_user_pages() is supposed to lock the memory, because drivers
    use it for DMA'ing directly into user memory.

    -- 
    Timur Tabi
    Staff Software Engineer
    timur.tabi@ammasso.com
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Paul Fulghum: "Re: Serial driver hangs"

    Relevant Pages

    • [PATCH] Integrating SEP Driver with RAR Driver
      ... RAR stands for Restricted Access Region; this is memory ... This is upstream revision 4 of the SEP driver. ... +This functions maps and allocates the shared area on the external ...
      (Linux-Kernel)
    • PROBLEM: Memory leak in -test9?
      ... There seems to be a memory leak in 2.6.0-test9. ... 0cf8-0cff: PCI conf1 ... 16 nodes reported by PnP BIOS; 16 recorded by driver ... ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 ...
      (Linux-Kernel)
    • Re: Problem isolating blue screen of death problem
      ... Parameter 4 is the location of the device driver causing the problem. ... memory to disk or retrieves a page of memory from disk to memory. ... select Task Manager and click the Performance ... Kernel Summary Dump File: Only kernel address space is available ...
      (microsoft.public.windowsxp.help_and_support)
    • PROBLEM REMAINS: [sata_nv ADMA breaks ATAPI] Crash on accessing DVD-RAM
      ... My system has 4G of physical memory, but when I use mem=4096M kernel sees only ... Port Connector Information ... Internal Connector Type: On Board IDE ... Real Time Clock Driver v1.12ac ...
      (Linux-Kernel)
    • redhat 7.3 installation
      ... Linux agpgart interface v0.99 Jeff Hartmann ... agpgart: Maximum main memory to use for agp memory: 202M ... PCI: PCI BIOS revision 2.10 entry at 0xf0900, ... Serial driver version 5.05c with MANY_PORTS MULTIPORT SHARE_IRQ SERIAL_PCI ISAPNP enabled ...
      (RedHat)