Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3781740ybi; Mon, 29 Jul 2019 12:31:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaVWZbOe/PZQG1NoupWNYWPw/F9YLYAD3F3OKSXGlakuqos4QS0cz3c+gSKnBEzhn5ZTUe X-Received: by 2002:a62:2c8e:: with SMTP id s136mr38631200pfs.3.1564428664399; Mon, 29 Jul 2019 12:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564428664; cv=none; d=google.com; s=arc-20160816; b=k4dNGqgrRx2fBY9GwGLvg7vYSHFcXjKOwYWcwtxFymtxV2omnclHMXAi9EgWrsITf2 4ZmBiY1wTHN/Dr/o1Rvqi8R/nkze2RoJR50+PRxoF6XtdLbp3ftHnWuvFagQMdh4RdH6 dgMQIVhJ3VxX2WYq9kdENccositKI/LooA7llfKtvk6HWSll3Q4nKNxYpW6U3tkmHc0O FMgapDOXxJmDEl2o/ZrlWkxMs0RP664aWYsafj5SpWECdmrQvA8Ej0yYUW86b/Zszn25 AwoJo1oaa8KFVU+ZxnNBq9O3MEikzVAbSOQJBNuTIb2rimgS/48Hz3RCH4Q9+YqtBQ9l gZwQ== 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=S08JyecU8K8ncYhKyMUKp1kJEMwdjPIR9zpS5xe1j50=; b=Htk1W3U6sJsJAHGAx2REJ1rAO07GQbBexQCNaFKi23Yl6G90nMc35BysvNPnHFMZOu HfEyI+5Wgzfvxs/l+iPgvng52cUUx/D7RnDuCldk63qQVkgbbjUGZcAkqZ2DVNH2AUpV ay9nxmhvN4Ft0+UFVtIdOoKe1bjUxXJsBtWhSbZBluOYP+LyqvI8CrF4O1qbg2CVxGEZ TSWXxHNeXMQfvwJyNftyOcNFxEqhrSIxLPjkwjzKEHbBln1Jgtu3N4CJaJJC8M5pFwDU Tdu/eXuinhqsn+zudEQA/sOddoBZDt7T2OYG0aN1/tDpRxlCv7CUT6YDhSgC/m5BBZLE 7LIQ== 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 h10si28398733pfk.197.2019.07.29.12.30.49; Mon, 29 Jul 2019 12:31:04 -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 S1728400AbfG2S6z (ORCPT + 99 others); Mon, 29 Jul 2019 14:58:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:55892 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727089AbfG2S6z (ORCPT ); Mon, 29 Jul 2019 14:58:55 -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 E2B4CAD85; Mon, 29 Jul 2019 18:58:53 +0000 (UTC) Date: Mon, 29 Jul 2019 20:58:53 +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: <20190729185853.GJ9330@dhcp22.suse.cz> References: <20190727171047.31610-1-longman@redhat.com> <20190729091249.GE9330@dhcp22.suse.cz> <556445a2-8912-c017-413c-7a4f36c4b89e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <556445a2-8912-c017-413c-7a4f36c4b89e@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 Mon 29-07-19 11:27:35, Waiman Long wrote: > On 7/29/19 5:12 AM, Michal Hocko wrote: > > 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? > > As explained in my response to Peter, I found that resource like swap > space were depleted even after the exit of the offending program in a > mostly idle system. This patch is to make sure that those resources get > freed after program exit ASAP. Could you elaborate more? How can a mm counter (do not confuse with mm_users) prevent address space to be torn down on exit? -- Michal Hocko SUSE Labs