From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by kanga.kvack.org (Postfix) with ESMTP id 777176B0254 for ; Wed, 4 Nov 2015 04:20:48 -0500 (EST) Received: by pacdm15 with SMTP id dm15so23578870pac.3 for ; Wed, 04 Nov 2015 01:20:48 -0800 (PST) Received: from out21.biz.mail.alibaba.com (out114-136.biz.mail.alibaba.com. [205.204.114.136]) by mx.google.com with ESMTP id gn6si814968pbc.40.2015.11.04.01.20.44 for ; Wed, 04 Nov 2015 01:20:47 -0800 (PST) Reply-To: "Hillf Danton" From: "Hillf Danton" 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 Content-Language: zh-cn Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" Cc: Andrew Morton , Andrea Arcangeli , Hugh Dickins , Naoya Horiguchi , Sasha Levin , linux-kernel , linux-mm@kvack.org, 'Minchan Kim' > @@ -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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org