Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756427AbbBQJ2h (ORCPT ); Tue, 17 Feb 2015 04:28:37 -0500 Received: from www.linutronix.de ([62.245.132.108]:42863 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754871AbbBQJ2f (ORCPT ); Tue, 17 Feb 2015 04:28:35 -0500 Date: Tue, 17 Feb 2015 10:28:32 +0100 From: Sebastian Andrzej Siewior To: Mike Galbraith Cc: Nikita Yushchenko , linux-rt-users@vger.kernel.org, "'Alexey Lugovskoy'" , Konstantin Kholopov , linux-kernel@vger.kernel.org, Steven Rostedt Subject: Re: [v3.10-rt / v3.12-rt] scheduling while atomic in cgroup code Message-ID: <20150217092832.GC26177@linutronix.de> References: <53A50218.6020506@dev.rtsoft.ru> <1403338188.6766.6.camel@marge.simpson.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1403338188.6766.6.camel@marge.simpson.net> X-Key-Id: 97C4700B X-Key-Fingerprint: 09E2 D1F3 9A3A FF13 C3D3 961C 0688 1C1E 97C4 700B 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 Content-Length: 1743 Lines: 61 * Mike Galbraith | 2014-06-21 10:09:48 [+0200]: >--- a/mm/memcontrol.c >+++ b/mm/memcontrol.c >@@ -2398,16 +2398,18 @@ static bool consume_stock(struct mem_cgr > { > struct memcg_stock_pcp *stock; > bool ret = true; >+ int cpu; > > if (nr_pages > CHARGE_BATCH) > return false; > >- stock = &get_cpu_var(memcg_stock); >+ cpu = get_cpu_light(); >+ stock = &per_cpu(memcg_stock, cpu); > if (memcg == stock->cached && stock->nr_pages >= nr_pages) > stock->nr_pages -= nr_pages; > else /* need to call res_counter_charge */ > ret = false; >- put_cpu_var(memcg_stock); >+ put_cpu_light(); > return ret; > } I am not taking this chunk. That preempt_disable() is lower weight and there is nothing happening that does not work with it. >@@ -2457,14 +2459,17 @@ static void __init memcg_stock_init(void > */ > static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) > { >- struct memcg_stock_pcp *stock = &get_cpu_var(memcg_stock); >+ struct memcg_stock_pcp *stock; >+ int cpu = get_cpu_light(); >+ >+ stock = &per_cpu(memcg_stock, cpu); > > if (stock->cached != memcg) { /* reset if necessary */ > drain_stock(stock); > stock->cached = memcg; > } I am a little more worried that drain_stock() could be called more than once on the same CPU. - memcg_cpu_hotplug_callback() doesn't disable preemption - drain_local_stock() doesn't as well so maybe it doesn't matter. > stock->nr_pages += nr_pages; >- put_cpu_var(memcg_stock); >+ put_cpu_light(); > } Sebastian -- 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/