Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753468AbbHSJWE (ORCPT ); Wed, 19 Aug 2015 05:22:04 -0400 Received: from mga02.intel.com ([134.134.136.20]:35154 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753187AbbHSJWB (ORCPT ); Wed, 19 Aug 2015 05:22:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,709,1432623600"; d="scan'208";a="771620009" From: "Kirill A. Shutemov" To: Andrew Morton , Hugh Dickins Cc: Andrea Arcangeli , Dave Hansen , Vlastimil Babka , Johannes Weiner , Michal Hocko , David Rientjes , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A. Shutemov" Subject: [PATCHv3 0/5] Fix compound_head() race Date: Wed, 19 Aug 2015 12:21:41 +0300 Message-Id: <1439976106-137226-1-git-send-email-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2126 Lines: 53 Here's my attempt on fixing recently discovered race in compound_head(). It should make compound_head() reliable in all contexts. The patchset is against Linus' tree. Let me know if it need to be rebased onto different baseline. It's expected to have conflicts with my page-flags patchset and probably should be applied before it. v3: - Fix build without hugetlb; - Drop page->first_page; - Update comment for free_compound_page(); - Use 'unsigned int' for page order; v2: Per Hugh's suggestion page->compound_head is moved into third double word. This way we can avoid memory overhead which v1 had in some cases. This place in struct page is rather overloaded. More testing is required to make sure we don't collide with anyone. Kirill A. Shutemov (5): mm: drop page->slab_page zsmalloc: use page->private instead of page->first_page mm: pack compound_dtor and compound_order into one word in struct page mm: make compound_head() robust mm: use 'unsigned int' for page order Documentation/vm/split_page_table_lock | 4 +- arch/xtensa/configs/iss_defconfig | 1 - include/linux/mm.h | 82 +++++++++++----------------------- include/linux/mm_types.h | 21 ++++++--- include/linux/page-flags.h | 80 ++++++++------------------------- mm/Kconfig | 12 ----- mm/debug.c | 5 --- mm/huge_memory.c | 3 +- mm/hugetlb.c | 35 +++++++-------- mm/internal.h | 8 ++-- mm/memory-failure.c | 7 --- mm/page_alloc.c | 76 ++++++++++++++++++------------- mm/swap.c | 4 +- mm/zsmalloc.c | 11 +++-- 14 files changed, 133 insertions(+), 216 deletions(-) -- 2.5.0 -- 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/