Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964780AbbKDJUt (ORCPT ); Wed, 4 Nov 2015 04:20:49 -0500 Received: from out4133-146.mail.aliyun.com ([42.120.133.146]:58411 "EHLO out4133-146.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932241AbbKDJUq (ORCPT ); Wed, 4 Nov 2015 04:20:46 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03296;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=9;SR=0; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "Kirill A. Shutemov" Cc: "Andrew Morton" , "Andrea Arcangeli" , "Hugh Dickins" , "Naoya Horiguchi" , "Sasha Levin" , "linux-kernel" , , "'Minchan Kim'" References: <052401d116e0$c3ac0110$4b040330$@alibaba-inc.com> In-Reply-To: <052401d116e0$c3ac0110$4b040330$@alibaba-inc.com> Subject: Re: [PATCH 3/4] thp: fix split vs. unmap race Date: Wed, 04 Nov 2015 17:20:15 +0800 Message-ID: <052701d116e2$0437a2b0$0ca6e810$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGg31LnRvRcEv8LFJvuU+ts3KNj2J7sAuaA Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1156 Lines: 35 > @@ -1135,20 +1135,12 @@ void do_page_add_anon_rmap(struct page *page, > bool compound = flags & RMAP_COMPOUND; > bool first; > > - if (PageTransCompound(page)) { > + if (compound) { > + atomic_t *mapcount; > VM_BUG_ON_PAGE(!PageLocked(page), page); > - if (compound) { > - atomic_t *mapcount; > - > - VM_BUG_ON_PAGE(!PageTransHuge(page), page); > - mapcount = compound_mapcount_ptr(page); > - first = atomic_inc_and_test(mapcount); > - } else { > - /* Anon THP always mapped first with PMD */ > - first = 0; > - VM_BUG_ON_PAGE(!page_mapcount(page), page); > - atomic_inc(&page->_mapcount); > - } > + VM_BUG_ON_PAGE(!PageTransHuge(page), page); > + mapcount = compound_mapcount_ptr(page); > + first = atomic_inc_and_test(mapcount); > } else { > VM_BUG_ON_PAGE(compound, page); Then this debug info is no longer needed. > first = atomic_inc_and_test(&page->_mapcount); -- 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/