Re: [PATCH 4/4] Hugetlb: Copy on Write support

From: David Gibson (david_at_gibson.dropbear.id.au)
Date: 11/10/05

  • Next message: William Lee Irwin III: "Re: [PATCH 4/4] Hugetlb: Copy on Write support"
    Date:	Thu, 10 Nov 2005 11:49:07 +1100
    To: William Lee Irwin III <wli@holomorphy.com>
    
    

    On Wed, Nov 09, 2005 at 04:15:34PM -0800, William Lee Irwin wrote:
    > On Wed, Nov 09, 2005 at 05:39:55PM -0600, Adam Litke wrote:
    > > Hugetlb: Copy on Write support
    > > Implement copy-on-write support for hugetlb mappings so MAP_PRIVATE can be
    > > supported. This helps us to safely use hugetlb pages in many more
    > > applications. The patch makes the following changes. If needed, I also have
    > > it broken out according to the following paragraphs.
    > > 1. Add a pair of functions to set/clear write access on huge ptes. The
    > > writable check in make_huge_pte is moved out to the caller for use by COW
    > > later.
    > > 2. Hugetlb copy-on-write requires special case handling in the following
    > > situations:
    > > - copy_hugetlb_page_range() - Copied pages must be write protected so a COW
    > > fault will be triggered (if necessary) if those pages are written to.
    > > - find_or_alloc_huge_page() - Only MAP_SHARED pages are added to the page
    > > cache. MAP_PRIVATE pages still need to be locked however.
    > > 3. Provide hugetlb_cow() and calls from hugetlb_fault() and hugetlb_no_page()
    > > which handles the COW fault by making the actual copy.
    > > 4. Remove the check in hugetlbfs_file_map() so that MAP_PRIVATE mmaps will be
    > > allowed. Make MAP_HUGETLB exempt from the depricated VM_RESERVED mapping
    > > check.
    >
    > Did you do the audit of pte protection bits I asked about? If not, I'll
    > dredge them up and check to make sure.

    I still don't know what you're talking about here - you never
    responded to my mail asking for clarification. The hugepage code
    already relies on pte_mkwrite() and pte_wrprotect() working correctly,
    I don't see that COW makes any difference.

    -- 
    David Gibson			| I'll have my music baroque, and my code
    david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
    				| _way_ _around_!
    http://www.ozlabs.org/~dgibson
    -
    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: William Lee Irwin III: "Re: [PATCH 4/4] Hugetlb: Copy on Write support"

    Relevant Pages

    • [PATCH] fix page->count discrepancy for zero page
      ... So, each time there's a COW fault on the zero-page, you ... In any case, it the bug doesn't cause any real problems, but it is a bit ... Attached patch is against 2.6.7 and applies to -mm3 properly. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Autotune swappiness01
      ... >> Attached is a patch designed to improve the behaviour of the swappiness knob ... >> conditions of heavy or sustained file stress while allowing applications to ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] make uselib configurable (was Re: uselib() & 2.6.X?)
      ... >> The possibility is that there might be unknown applications which use ... > Until there's a list of obsolete syscalls, we can't say for sure, ... > Even if the final patch is unable to benefit many users, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: move O_LARGEFILE forcing to filp_open()
      ... > Unfortunately, this will also cause problems for 32-bit emulation, where ... > 32 bit applications. ... Your patch is also necessary; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: pts/X counts on
      ... >> applications. ... The change was part of a patch that made pty's ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)