From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752866AbbCaWba (ORCPT ); Tue, 31 Mar 2015 18:31:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54635 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751243AbbCaWb2 (ORCPT ); Tue, 31 Mar 2015 18:31:28 -0400 Date: Tue, 31 Mar 2015 15:31:27 -0700 From: Andrew Morton To: Sasha Levin Cc: linux-kernel@vger.kernel.org, mhocko@suse.cz, Mel Gorman , Vlastimil Babka , Johannes Weiner , David Rientjes , Joonsoo Kim , linux-mm@kvack.org (open list:MEMORY MANAGEMENT) Subject: Re: [PATCH 1/2] mm: free large amount of 0-order pages in workqueue Message-Id: <20150331153127.2eb8cc2f04c742dde7a8c96c@linux-foundation.org> In-Reply-To: <1427839895-16434-1-git-send-email-sasha.levin@oracle.com> References: <1427839895-16434-1-git-send-email-sasha.levin@oracle.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 31 Mar 2015 18:11:32 -0400 Sasha Levin wrote: > Freeing pages became a rather costly operation, specially when multiple debug > options are enabled. This causes hangs when an attempt to free a large amount > of 0-order is made. Two examples are vfree()ing large block of memory, and > punching a hole in a shmem filesystem. > > To avoid that, move any free operations that involve batching pages into a > list to a workqueue handler where they could be freed later. eek. __free_pages() is going to be a hot path for someone - it has 500+ callsites. And this patch might cause problems for rt_prio() tasks which run for a long time, starving out the workqueue thread. And probably other stuff I didn't think of... What whacky debug option is actually causing this? Full-page poisoning? Stick a cond_resched() in __vunmap() ;)