From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933387AbbFJIOv (ORCPT ); Wed, 10 Jun 2015 04:14:51 -0400 Received: from cantor2.suse.de ([195.135.220.15]:58669 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752623AbbFJIOi (ORCPT ); Wed, 10 Jun 2015 04:14:38 -0400 Date: Wed, 10 Jun 2015 09:14:32 +0100 From: Mel Gorman To: Ingo Molnar Cc: Andrew Morton , Rik van Riel , Hugh Dickins , Minchan Kim , Dave Hansen , Andi Kleen , H Peter Anvin , Linus Torvalds , Thomas Gleixner , Peter Zijlstra , Linux-MM , LKML Subject: Re: [PATCH 2/4] mm: Send one IPI per CPU to TLB flush all entries after unmapping pages Message-ID: <20150610081432.GY26425@suse.de> References: <1433871118-15207-1-git-send-email-mgorman@suse.de> <1433871118-15207-3-git-send-email-mgorman@suse.de> <20150610074704.GA18049@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20150610074704.GA18049@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 10, 2015 at 09:47:04AM +0200, Ingo Molnar wrote: > > * Mel Gorman wrote: > > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -1289,6 +1289,18 @@ enum perf_event_task_context { > > perf_nr_task_contexts, > > }; > > > > +/* Track pages that require TLB flushes */ > > +struct tlbflush_unmap_batch { > > + /* > > + * Each bit set is a CPU that potentially has a TLB entry for one of > > + * the PFNs being flushed. See set_tlb_ubc_flush_pending(). > > + */ > > + struct cpumask cpumask; > > + > > + /* True if any bit in cpumask is set */ > > + bool flush_required; > > +}; > > + > > struct task_struct { > > volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ > > void *stack; > > @@ -1648,6 +1660,10 @@ struct task_struct { > > unsigned long numa_pages_migrated; > > #endif /* CONFIG_NUMA_BALANCING */ > > > > +#ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH > > + struct tlbflush_unmap_batch *tlb_ubc; > > +#endif > > Please embedd this constant size structure in task_struct directly so that the > whole per task allocation overhead goes away: > That puts a structure (72 bytes in the config I used) within the task struct even when it's not required. On a lightly loaded system direct reclaim will not be active and for some processes, it'll never be active. It's very wasteful. -- Mel Gorman SUSE Labs