Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3182814ybi; Mon, 29 Jul 2019 02:20:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6aBmNif/oR6Z+b+uEg5sx/sI3yYZLRB3Paf/3EJMWLEhY6SvvbgYy3yKVCqDQyTAWTjrK X-Received: by 2002:a63:2744:: with SMTP id n65mr89966631pgn.277.1564392005724; Mon, 29 Jul 2019 02:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564392005; cv=none; d=google.com; s=arc-20160816; b=GWB8GI7ras5tTxlN9kC+5L4kiHYC+ivQS23WMqzA9UAESmXo9QIHmmcp1fldb2KxXK gCvlQ84KPC//pv9tSq7GD3G1nknORSa4CmxJdMNl8R3hJBvrjpPTcKEzTp77BxClrGAU 3FIwEEzTo2+DYKwO3B9vd/NeoXGam/J/fJlq9yGsaj8lo8PIsRRRNXycU0JP3X43AfVe jjUEK+lDfHPSWqB7binDeghCNufRGetKEs1LaeqMT+aPtCbuMXpVmXEjFbdxu1T7DQG6 nU29Tc6/NzV1MXRzOZOieBDMLNLjZMH3kKZkwhb3uvWinJ35ufDoA/0exPjEWg6L6p8D Cilw== 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=UkRu0wZ839kXF1j1bCmJnioGpdo1W/FJJ4f7nrTYBCo=; b=XhXiAK+yeqO1z17gcxn+ljTA5cOCS7Moy242EK+uyqbfgyQoK7lZTwTZ9V7nt6eD7/ JV2U0h6GeBofOHyM04d6GxGJPqreuGJZLzlfzbyMScIpaOum+Y2vPMsBByV4961JrCJ7 +3kBVRLw1v94EGznD9EliyDuvF+IWnPuX5ij7i3Ile0PKVbwl7ZSUnWoCl8RxK1/7DeX 0LNvrq3Kl5JXSitCfy3dzPaa7gNzUk37Vhs1PW76bmrE6MRElgpSEf1ROpQ4VKN9PK+u jii9XIETEFdKbtRaSFLKhJa6g8c3up+aqWAbjZIG8UZf+NwCWE7e2/vLtEKgOMe0mKU+ RJEQ== 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 y14si10548915pfr.82.2019.07.29.02.19.50; Mon, 29 Jul 2019 02:20:05 -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 S1727161AbfG2JMv (ORCPT + 99 others); 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