Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757521Ab3GQWmS (ORCPT ); Wed, 17 Jul 2013 18:42:18 -0400 Received: from mga09.intel.com ([134.134.136.24]:51534 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756427Ab3GQWmQ (ORCPT ); Wed, 17 Jul 2013 18:42:16 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,687,1367996400"; d="scan'208";a="347379562" From: "Kirill A. Shutemov" To: Andrew Morton Cc: "Kirill A. Shutemov" , Andrea Arcangeli , Al Viro , Hugh Dickins , Wu Fengguang , Jan Kara , Mel Gorman , linux-mm@kvack.org, Andi Kleen , Matthew Wilcox , "Kirill A. Shutemov" , Hillf Danton , Dave Hansen , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20130717140953.7560e88e607f8f5df1b1fdd8@linux-foundation.org> References: <1373885274-25249-1-git-send-email-kirill.shutemov@linux.intel.com> <1373885274-25249-6-git-send-email-kirill.shutemov@linux.intel.com> <20130717140953.7560e88e607f8f5df1b1fdd8@linux-foundation.org> Subject: Re: [PATCH 5/8] thp, mm: locking tail page is a bug Content-Transfer-Encoding: 7bit Message-Id: <20130717224518.6DDAAE0090@blue.fi.intel.com> Date: Thu, 18 Jul 2013 01:45:18 +0300 (EEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1628 Lines: 50 Andrew Morton wrote: > On Mon, 15 Jul 2013 13:47:51 +0300 "Kirill A. Shutemov" wrote: > > > From: "Kirill A. Shutemov" > > > > Locking head page means locking entire compound page. > > If we try to lock tail page, something went wrong. > > > > .. > > > > --- a/mm/filemap.c > > +++ b/mm/filemap.c > > @@ -639,6 +639,7 @@ void __lock_page(struct page *page) > > { > > DEFINE_WAIT_BIT(wait, &page->flags, PG_locked); > > > > + VM_BUG_ON(PageTail(page)); > > __wait_on_bit_lock(page_waitqueue(page), &wait, sleep_on_page, > > TASK_UNINTERRUPTIBLE); > > } > > @@ -648,6 +649,7 @@ int __lock_page_killable(struct page *page) > > { > > DEFINE_WAIT_BIT(wait, &page->flags, PG_locked); > > > > + VM_BUG_ON(PageTail(page)); > > return __wait_on_bit_lock(page_waitqueue(page), &wait, > > sleep_on_page_killable, TASK_KILLABLE); > > } > > lock_page() is a pretty commonly called function, and I assume quite a > lot of people run with CONFIG_DEBUG_VM=y. > > Is the overhead added by this patch really worthwhile? I found it useful, especially, when I was starting experiments with THP for pagecache. But feel free to drop it if think that it adds to much overhead. > I'm thinking I might leave it in -mm indefinitely but not send it > upstream. Works for me too. -- Kirill A. Shutemov -- 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/