Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3130160ybi; Mon, 29 Jul 2019 01:24:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxganTUZSlit+1L02ij0gSQtkgrBk6N6FoDCxmAdoozjrNpBGPO1ffqRP4KZ4xWat8FGER/ X-Received: by 2002:aa7:8705:: with SMTP id b5mr36876550pfo.27.1564388660972; Mon, 29 Jul 2019 01:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564388660; cv=none; d=google.com; s=arc-20160816; b=weC220Kr6Jk4iZ3AUTGDsIdgeyslOrV75EIwpN+8bK/I26MVPDv40d5TWlPmQDr888 f3DyW+cCcVjqck8rEQClRztlwxMx6R674lFzJzqLFy7o8RlAY9/gcjWXKJHlHqJo4P0w UGj4McYVRIwbwEOpoaqbsGZ7nvpBcoqcGW3GgvxBz8w7lm79kWIs1cvCY5821tII2AZx X7ze1Fv/vAdvqKnQEPona0iYALmTb+RFSP6r7emDwnHiTCcuC9ON0+nN9pO8z6Tulmjp boj8yxmhtFJI8RvUJlOK4t3FmpL9um+6RSFdB8cNblVkjsBHW9gXWgRGMZXtGdN4hYwE t/Iw== 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=zv1jyHrQhg/anG79DXIg6d42L7l6b6qBUMNYIf//wxg=; b=IyLq+rSh387zhy2jk+yNTAIrfCM/FGN/UgXsmOtdbr3LNcgVLFV05Hj5ZmqoIbZmMJ Hr75L+1wmFiY0JtqZq2wx/LFWvjOkyIDi1pQnHKpaBjWdPF/9pTJ+VPLbHXdjgLmoOjZ wZ5NRfdZDQjpbygcfHYDmKfVzhDvWio0xS/l0fS2xy92FoLIuSH0wF4cLv9fq2GT9O4K +1HHAoyV/Ygxvv8mHEMXYrSj1VDfit2hm3aPknQ3Dh3ILxglJHqOzJojyXM6+04BD8dM DJ8FXI0kKIJULs/a7B0MbFsRs1Pv3bJQiTp1XL/QlR/2jF7OeU6UskrFj9MifTlMxB3P Ym7A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23si26321806pls.189.2019.07.29.01.24.05; Mon, 29 Jul 2019 01:24:20 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727581AbfG2ISF (ORCPT + 99 others); Mon, 29 Jul 2019 04:18:05 -0400 Received: from foss.arm.com ([217.140.110.172]:39686 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbfG2ISF (ORCPT ); Mon, 29 Jul 2019 04:18:05 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7D12E337; Mon, 29 Jul 2019 01:18:04 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (unknown [10.1.194.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 78F283F575; Mon, 29 Jul 2019 01:18:03 -0700 (PDT) Date: Mon, 29 Jul 2019 09:18:01 +0100 From: Qais Yousef 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: <20190729081800.qbamrvsf4rjna656@e107158-lin.cambridge.arm.com> References: <20190727171047.31610-1-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190727171047.31610-1-longman@redhat.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/27/19 13:10, 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. > > 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. I don't really know a lot about this code, but does the owner field has to depend on CONFIG_MEMCG? ie: can't the owner be always set? Cheers -- Qais Yousef