From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752683AbbGNOBo (ORCPT ); Tue, 14 Jul 2015 10:01:44 -0400 Received: from mga11.intel.com ([192.55.52.93]:45348 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751484AbbGNOBn (ORCPT ); Tue, 14 Jul 2015 10:01:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,472,1432623600"; d="scan'208";a="764178765" From: "Kirill A. Shutemov" To: "Kirill A. Shutemov" Cc: Andrew Morton , Andrea Arcangeli , Hugh Dickins , Dave Hansen , Mel Gorman , Rik van Riel , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Steve Capper , "Aneesh Kumar K.V" , Johannes Weiner , Michal Hocko , Jerome Marchand , Sasha Levin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A. Shutemov" In-Reply-To: <1436550130-112636-14-git-send-email-kirill.shutemov@linux.intel.com> References: <1436550130-112636-1-git-send-email-kirill.shutemov@linux.intel.com> <1436550130-112636-14-git-send-email-kirill.shutemov@linux.intel.com> Subject: RE: [PATCH 13/36] mm: drop tail page refcounting Content-Transfer-Encoding: 7bit Message-Id: <20150714140135.81C368B@black.fi.intel.com> Date: Tue, 14 Jul 2015 17:01:35 +0300 (EEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kirill A. Shutemov wrote: > Tail page refcounting is utterly complicated and painful to support. > > It uses ->_mapcount on tail pages to store how many times this page is > pinned. get_page() bumps ->_mapcount on tail page in addition to > ->_count on head. This information is required by split_huge_page() to > be able to distribute pins from head of compound page to tails during > the split. > > We will need ->_mapcount to account PTE mappings of subpages of the > compound page. We eliminate need in current meaning of ->_mapcount in > tail pages by forbidding split entirely if the page is pinned. > > The only user of tail page refcounting is THP which is marked BROKEN for > now. > > Let's drop all this mess. It makes get_page() and put_page() much > simpler. > > Signed-off-by: Kirill A. Shutemov > Tested-by: Sasha Levin > Acked-by: Vlastimil Babka checkpatch fixlet: diff --git a/include/linux/mm.h b/include/linux/mm.h index 57fcb78a3cef..681997bccc52 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -493,7 +493,7 @@ static inline void init_page_count(struct page *page) atomic_set(&page->_count, 1); } -void __put_page(struct page* page); +void __put_page(struct page *page); static inline void put_page(struct page *page) {