Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932313Ab3IPL0A (ORCPT ); Mon, 16 Sep 2013 07:26:00 -0400 Received: from mga03.intel.com ([143.182.124.21]:54205 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756658Ab3IPLZ4 (ORCPT ); Mon, 16 Sep 2013 07:25:56 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,914,1371106800"; d="scan'208";a="295359058" From: "Kirill A. Shutemov" To: Alex Thorlton , Ingo Molnar , Andrew Morton , Naoya Horiguchi Cc: "Eric W . Biederman" , "Paul E . McKenney" , Al Viro , Andi Kleen , Andrea Arcangeli , Dave Hansen , Dave Jones , David Howells , Frederic Weisbecker , Johannes Weiner , Kees Cook , Mel Gorman , Michael Kerrisk , Oleg Nesterov , Peter Zijlstra , Rik van Riel , Robin Holt , Sedat Dilek , Srikar Dronamraju , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A. Shutemov" Subject: [PATCHv2 3/9] mm: introduce api for split page table lock for PMD level Date: Mon, 16 Sep 2013 14:25:34 +0300 Message-Id: <1379330740-5602-4-git-send-email-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1379330740-5602-1-git-send-email-kirill.shutemov@linux.intel.com> References: <1379330740-5602-1-git-send-email-kirill.shutemov@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1341 Lines: 41 Basic api, backed by mm->page_table_lock for now. Actual implementation will be added later. Signed-off-by: Naoya Horiguchi Signed-off-by: Kirill A. Shutemov --- include/linux/mm.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 6cf8ddb..e3481c6 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1294,6 +1294,19 @@ static inline void pgtable_page_dtor(struct page *page) ((unlikely(pmd_none(*(pmd))) && __pte_alloc_kernel(pmd, address))? \ NULL: pte_offset_kernel(pmd, address)) +static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd) +{ + return &mm->page_table_lock; +} + + +static inline spinlock_t *pmd_lock(struct mm_struct *mm, pmd_t *pmd) +{ + spinlock_t *ptl = pmd_lockptr(mm, pmd); + spin_lock(ptl); + return ptl; +} + extern void free_area_init(unsigned long * zones_size); extern void free_area_init_node(int nid, unsigned long * zones_size, unsigned long zone_start_pfn, unsigned long *zholes_size); -- 1.8.4.rc3 -- 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/