From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932299Ab3LDM43 (ORCPT ); Wed, 4 Dec 2013 07:56:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12070 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932201Ab3LDM42 (ORCPT ); Wed, 4 Dec 2013 07:56:28 -0500 Date: Wed, 4 Dec 2013 13:57:28 +0100 From: Oleg Nesterov To: Sameer Nanda Cc: Andrew Morton , David Rientjes , Frederic Weisbecker , Mandeep Singh Baines , "Ma, Xindong" , Michal Hocko , Sergey Dyasly , "Tu, Xiaobing" , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] oom_kill: change oom_kill.c to use for_each_thread() Message-ID: <20131204125728.GA2549@redhat.com> References: <20131202152423.GA10878@redhat.com> <20131202152440.GA10900@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sameer, I didn't notice this part yesterday. On 12/03, Sameer Nanda wrote: > > > @@ -406,7 +409,7 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, > > { > > struct task_struct *victim = p; > > struct task_struct *child; > > - struct task_struct *t = p; > > + struct task_struct *t; > > struct mm_struct *mm; > > unsigned int victim_points = 0; > > static DEFINE_RATELIMIT_STATE(oom_rs, DEFAULT_RATELIMIT_INTERVAL, > > @@ -437,7 +440,7 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, > > * still freeing memory. > > */ > > read_lock(&tasklist_lock); > This can be a rcu_read_lock now, I think? No, we need tasklist for list_for_each_entry(t->children), it is not rcu-safe. Oleg.