Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964792AbbLGWTw (ORCPT ); Mon, 7 Dec 2015 17:19:52 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:47920 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932607AbbLGWTt (ORCPT ); Mon, 7 Dec 2015 17:19:49 -0500 To: mhocko@kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, torvalds@linux-foundation.org, mgorman@suse.de, rientjes@google.com, riel@redhat.com, hughd@google.com, oleg@redhat.com, andrea@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH -v2] mm, oom: introduce oom reaper From: Tetsuo Handa References: <201511281339.JHH78172.SLOQFOFHVFOMJt@I-love.SAKURA.ne.jp> <201511290110.FJB87096.OHJLVQOSFFtMFO@I-love.SAKURA.ne.jp> <20151201132927.GG4567@dhcp22.suse.cz> <201512052133.IAE00551.LSOQFtMFFVOHOJ@I-love.SAKURA.ne.jp> <20151207160718.GA20774@dhcp22.suse.cz> In-Reply-To: <20151207160718.GA20774@dhcp22.suse.cz> Message-Id: <201512080719.EHD73429.JQHFtMOFLOFSVO@I-love.SAKURA.ne.jp> X-Mailer: Winbiff [Version 2.51 PL2] X-Accept-Language: ja,en,zh Date: Tue, 8 Dec 2015 07:19:42 +0900 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 783 Lines: 23 Michal Hocko wrote: > Yes you are right! The reference count should be incremented before > publishing the new mm_to_reap. I thought that an elevated ref. count by > the caller would be enough but this was clearly wrong. Does the update > below looks better? I think that moving mmdrop() from oom_kill_process() to oom_reap_vmas() xor wake_oom_reaper() makes the patch simpler. rcu_read_unlock(); + if (can_oom_reap) + wake_oom_reaper(mm); /* will call mmdrop() */ + else + mmdrop(mm); - mmdrop(mm); put_task_struct(victim); } -- 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/