Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752279AbbBWOZ0 (ORCPT ); Mon, 23 Feb 2015 09:25:26 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:49458 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751071AbbBWOZZ (ORCPT ); Mon, 23 Feb 2015 09:25:25 -0500 Date: Mon, 23 Feb 2015 15:25:14 +0100 From: Peter Zijlstra To: Vlastimil Babka Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Hugh Dickins , Andrea Arcangeli , "Kirill A. Shutemov" , Rik van Riel , Mel Gorman , Michal Hocko , Ebru Akagunduz , Alex Thorlton , David Rientjes , Ingo Molnar Subject: Re: [RFC 4/6] mm, thp: move collapsing from khugepaged to task_work context Message-ID: <20150223142514.GX5029@twins.programming.kicks-ass.net> References: <1424696322-21952-1-git-send-email-vbabka@suse.cz> <1424696322-21952-5-git-send-email-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424696322-21952-5-git-send-email-vbabka@suse.cz> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1309 Lines: 44 On Mon, Feb 23, 2015 at 01:58:40PM +0100, Vlastimil Babka wrote: > @@ -7713,8 +7820,15 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued) > entity_tick(cfs_rq, se, queued); > } > > - if (numabalancing_enabled) > - task_tick_numa(rq, curr); > + /* > + * For latency considerations, don't schedule the THP work together > + * with NUMA work. NUMA has higher priority, assuming remote accesses > + * have worse penalty than TLB misses. > + */ > + if (!(numabalancing_enabled && task_tick_numa(rq, curr)) > + && khugepaged_enabled()) > + task_tick_thp(rq, curr); > + > > update_rq_runnable_avg(rq, 1); > } That's a bit yucky; and I think there's no problem moving that update_rq_runnable_avg() thing up a bit; which would get you: static void task_tick_fair(..) { ... update_rq_runnable_avg(); if (numabalancing_enabled && task_tick_numa(rq, curr)) return; if (khugepaged_enabled() && task_tick_thp(rq, curr)) return; } Clearly the return on that second conditional is a tad pointless, but OCD :-) -- 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/