Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2065408ima; Mon, 22 Oct 2018 03:44:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV62PQIA/gUvGj76b/jU2y9bXybg7MRYL8/N/75ycSZIl9LxhvgeWsuSYxfdWCnthtPICydOR X-Received: by 2002:a17:902:6a83:: with SMTP id n3-v6mr44729625plk.288.1540205092224; Mon, 22 Oct 2018 03:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540205092; cv=none; d=google.com; s=arc-20160816; b=WWN7onL3YGHa2aYvKkPpJgPBGOS11lEpSDrjk++PDUriXrbUDf/y+LX0StURdCdxSd wRtqi1RJCfMt+v8jYt/dxtwBV8DJORPLXzv6qdNrZdn9uEj+X/saejEkJXzW4Y/kCtMi OI+rtM3KJ72Eu2K/tTJXuvE+q0PAXv8ttXmzzEJmT0/Syj5MCaoMf+iVEXZ4kiUZn+ct v0Vkp4WN3ovnWNEvulBNzw7Sb3Xv8nltA66vqgX4KBPwwpHDLvUj7nPLzhRjl3blnWYM OknNPCkkvRXq/ECodeQ+9d48uQorBgYD7MTcY0z2sGhG+Fudl9sDeVfbf2dglOSPKhvd lVkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=4bFjCLzkBGjK8G99jpRW2lydG6pWnCvx+gPYjk/Bv78=; b=ONyXE4MaXgMqNneKVIF4FCmgxtpQOHI1ohgTGXlVRzFjRWbzmNXuvXRns4bExSNkJL bhCRuC4U+kM3Uv0kofs6WE8G25NG045UEUHQtNvYWWMxUu2p6tKUBXXlqukZkLHYjw/l rPuxKVp2n8s0Fh+QggK89BobgG6foqO0JlkRc//rEdlZYU2KU/2QHb9uHEEk1EIuODXf ILqmdiVYGHvFiuoMpC1ZckX6hU+Mmm4ojfhXyEmVCby3UqVpo7AYV6/4QzrU0KUUYcgO y/y2Vgf08L4euo93aMTLUQUYpErGmOUtTuN91NgQ/nsccrAKZnvDZx0Mli4sjgY3xwTg yJ9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37-v6si33679822pgp.211.2018.10.22.03.44.37; Mon, 22 Oct 2018 03:44:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728675AbeJVTBo (ORCPT + 99 others); Mon, 22 Oct 2018 15:01:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:53006 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727857AbeJVTBn (ORCPT ); Mon, 22 Oct 2018 15:01:43 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CEEFBAE86; Mon, 22 Oct 2018 10:43:41 +0000 (UTC) Date: Mon, 22 Oct 2018 12:43:41 +0200 From: Michal Hocko To: Tetsuo Handa Cc: linux-mm@kvack.org, Johannes Weiner , David Rientjes , Andrew Morton , LKML Subject: Re: [RFC PATCH 1/2] mm, oom: marks all killed tasks as oom victims Message-ID: <20181022104341.GY18839@dhcp22.suse.cz> References: <20181022071323.9550-1-mhocko@kernel.org> <20181022071323.9550-2-mhocko@kernel.org> <201810220758.w9M7wojE016890@www262.sakura.ne.jp> <20181022084842.GW18839@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 22-10-18 18:42:30, Tetsuo Handa wrote: > On 2018/10/22 17:48, Michal Hocko wrote: > > On Mon 22-10-18 16:58:50, Tetsuo Handa wrote: > >> Michal Hocko wrote: > >>> --- a/mm/oom_kill.c > >>> +++ b/mm/oom_kill.c > >>> @@ -898,6 +898,7 @@ static void __oom_kill_process(struct task_struct *victim) > >>> if (unlikely(p->flags & PF_KTHREAD)) > >>> continue; > >>> do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, PIDTYPE_TGID); > >>> + mark_oom_victim(p); > >>> } > >>> rcu_read_unlock(); > >>> > >>> -- > >> > >> Wrong. Either > > > > You are right. The mm might go away between process_shares_mm and here. > > While your find_lock_task_mm would be correct I believe we can do better > > by using the existing mm that we already have. I will make it a separate > > patch to clarity. > > Still wrong. p->mm == NULL means that we are too late to set TIF_MEMDIE > on that thread. Passing non-NULL mm to mark_oom_victim() won't help. Why would it be too late? Or in other words why would this be harmful? -- Michal Hocko SUSE Labs