From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by kanga.kvack.org (Postfix) with ESMTP id 582A66B0031 for ; Tue, 15 Oct 2013 07:33:00 -0400 (EDT) Received: by mail-pd0-f174.google.com with SMTP id y13so8725404pdi.19 for ; Tue, 15 Oct 2013 04:33:00 -0700 (PDT) From: "Kirill A. Shutemov" In-Reply-To: References: Subject: RE: mm: fix BUG in __split_huge_page_pmd Content-Transfer-Encoding: 7bit Message-Id: <20131015113254.14E88E0090@blue.fi.intel.com> Date: Tue, 15 Oct 2013 14:32:54 +0300 (EEST) Sender: owner-linux-mm@kvack.org List-ID: To: Hugh Dickins Cc: Andrew Morton , Andrea Arcangeli , David Rientjes , "Kirill A. Shutemov" , Naoya Horiguchi , linux-kernel@vger.kernel.org, linux-mm@kvack.org Hugh Dickins wrote: > Occasionally we hit the BUG_ON(pmd_trans_huge(*pmd)) at the end of > __split_huge_page_pmd(): seen when doing madvise(,,MADV_DONTNEED). > > It's invalid: we don't always have down_write of mmap_sem there: > a racing do_huge_pmd_wp_page() might have copied-on-write to another > huge page before our split_huge_page() got the anon_vma lock. > > Forget the BUG_ON, just go back and try again if this happens. > > Signed-off-by: Hugh Dickins > Cc: stable@vger.kernel.org Looks reasonable to me. Acked-by: Kirill A. Shutemov madvise(MADV_DONTNEED) was aproblematic with THP before. Is a big win having mmap_sem taken on read rather than on write for it? -- Kirill A. Shutemov -- 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