From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by kanga.kvack.org (Postfix) with ESMTP id 289D54403D8 for ; Thu, 4 Feb 2016 08:12:03 -0500 (EST) Received: by mail-wm0-f51.google.com with SMTP id 128so26335627wmz.1 for ; Thu, 04 Feb 2016 05:12:03 -0800 (PST) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com. [2a00:1450:400c:c09::242]) by mx.google.com with ESMTPS id 10si38105089wmd.15.2016.02.04.05.12.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Feb 2016 05:12:02 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id g62so386053wme.2 for ; Thu, 04 Feb 2016 05:12:02 -0800 (PST) Date: Thu, 4 Feb 2016 15:11:59 +0200 From: "Kirill A. Shutemov" Subject: Re: [PATCH 3/3] thp: limit number of object to scan on deferred_split_scan() Message-ID: <20160204131159.GA20399@node.shutemov.name> References: <20160121012237.GE7119@redhat.com> <1453378163-133609-1-git-send-email-kirill.shutemov@linux.intel.com> <1453378163-133609-4-git-send-email-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1453378163-133609-4-git-send-email-kirill.shutemov@linux.intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Andrea Arcangeli Cc: "Kirill A. Shutemov" , 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 On Thu, Jan 21, 2016 at 03:09:23PM +0300, Kirill A. Shutemov wrote: > If we have a lot of pages in queue to be split, deferred_split_scan() > can spend unreasonable amount of time under spinlock with disabled > interrupts. > > Let's cap number of pages to split on scan by sc->nr_to_scan. > > Signed-off-by: Kirill A. Shutemov > Reported-by: Andrea Arcangeli > --- > mm/huge_memory.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index 36f98459f854..298dbc001b07 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -3478,17 +3478,19 @@ static unsigned long deferred_split_scan(struct shrinker *shrink, > int split = 0; > > spin_lock_irqsave(&pgdata->split_queue_lock, flags); > - list_splice_init(&pgdata->split_queue, &list); > - > /* Take pin on all head pages to avoid freeing them under us */ > list_for_each_safe(pos, next, &list) { Well, that's embarrassing... :-/ I forgot to commit one local change here. Sorry.