From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B727BC7618B for ; Mon, 29 Jul 2019 09:12:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E28E206DD for ; Mon, 29 Jul 2019 09:12:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564391572; bh=3d02EKjJm4O9dbv+9xbLgOQOwyUp4Wuvq3MjJrQVdbs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=lBxd+boJgXk3kS87+ptRJ4FKCHNFra3N+7fvKRY2SR/Dbv1kgsWqcwfQbqfjp7cmT JvrbWBgq6ONQaUnjy3LsSONEjBbwX3Od1L/F8Sn0YXNpr6Ix0o6ctc5ErnV6GYxw4t /IOguDYsa7rRhpVXYTEIEUsfwdu+cb2LeLx34/YM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727223AbfG2JMv (ORCPT ); Mon, 29 Jul 2019 05:12:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:33024 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726694AbfG2JMv (ORCPT ); Mon, 29 Jul 2019 05:12:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0304BB60C; Mon, 29 Jul 2019 09:12:50 +0000 (UTC) Date: Mon, 29 Jul 2019 11:12:49 +0200 From: Michal Hocko To: Waiman Long Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Phil Auld Subject: Re: [PATCH v2] sched/core: Don't use dying mm as active_mm of kthreads Message-ID: <20190729091249.GE9330@dhcp22.suse.cz> References: <20190727171047.31610-1-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190727171047.31610-1-longman@redhat.com> 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 Sat 27-07-19 13:10:47, Waiman Long wrote: > It was found that a dying mm_struct where the owning task has exited > can stay on as active_mm of kernel threads as long as no other user > tasks run on those CPUs that use it as active_mm. This prolongs the > life time of dying mm holding up memory and other resources like swap > space that cannot be freed. IIRC use_mm doesn't pin the address space. It only pins the mm_struct itself. So what exactly is the problem here? > > Fix that by forcing the kernel threads to use init_mm as the active_mm > if the previous active_mm is dying. > > The determination of a dying mm is based on the absence of an owning > task. The selection of the owning task only happens with the CONFIG_MEMCG > option. Without that, there is no simple way to determine the life span > of a given mm. So it falls back to the old behavior. Please don't. We really wont to remove mm->owner long term. -- Michal Hocko SUSE Labs