Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3862849ybi; Mon, 29 Jul 2019 14:09:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/Kxm8EsOf3r32Id3FUqx02gS/gR41NqN0Np7l4pkdasi/09BulyZZwssOyzw2tItajy/v X-Received: by 2002:a17:90a:2008:: with SMTP id n8mr111969949pjc.4.1564434543001; Mon, 29 Jul 2019 14:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564434542; cv=none; d=google.com; s=arc-20160816; b=KB+6myZhTleZdRTvqQojnr0U+L42mRcBmRM6fC+Hica155iMQa4z0hWh0DyIuCs/2R lcUnQW2BtkVhYNmh7+YuER4+IFg88gLws3fae/rgMl6rpPG3TRaVb6udYA+6QjGC9y9W 5U8zN/TLHrcOzzj7/OiDaBuuc+AsIU8gwZBHMXl1tV0/uPRMhipUQ3ZmNSooKbyGdpT4 va/WFtHmTVkcCjlVOcG6hAjT8jVIGNPdHOEQjjpZR/YK6YHBzxKu8nmzczrMprXokNoO UEH6lBKFz4mfI89HG1PlCsgA9E4AeK2739L5v2VYfLrqDxz9SZO/G+psvQpDduNk8LVL /GPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=B3H3C6ZPDZLEX1ZSFVklsnEgxt450nda5vCqv3ww180=; b=hA1j0d/pyn1Lsq4105ShCYUi0ToOKnxivSu2zJITD0qRDFLZyEDXwN2heqgIixcED1 mZjfkktntQ+NriZTsTQlRutooTsHJcWzlRHiBoWW+9B59VFmczvbTR+XBmcSTJsSD/Xz Kq+DQ6lZqkcck+LUOZjNbROjY7Rw04D2S7shvBU92+IRpVPnVjAMdT7TVGghCIZJNmCB K6fNMtiiprOG+4KHr383sTB8KDfU1TZG0ZEJa1XzBRBhpJB3F4GrggJUZeZVikEOuR19 7ov28o/GDP4VgTIgsp1Jcxt5O7b8shKjzE3QYu4DNj83C64Hs2sP83WNcXLM4rGuAdNO VdXQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i3si26533201pld.357.2019.07.29.14.08.46; Mon, 29 Jul 2019 14:09:02 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729327AbfG2VGh (ORCPT + 99 others); Mon, 29 Jul 2019 17:06:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46032 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbfG2VGh (ORCPT ); Mon, 29 Jul 2019 17:06:37 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2FB37FDEC; Mon, 29 Jul 2019 21:06:36 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-160.bos.redhat.com [10.18.17.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id 044505C1A1; Mon, 29 Jul 2019 21:06:35 +0000 (UTC) Subject: Re: [PATCH v2] sched/core: Don't use dying mm as active_mm of kthreads To: Qais Yousef Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Phil Auld References: <20190727171047.31610-1-longman@redhat.com> <20190729081800.qbamrvsf4rjna656@e107158-lin.cambridge.arm.com> From: Waiman Long Organization: Red Hat Message-ID: Date: Mon, 29 Jul 2019 17:06:35 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190729081800.qbamrvsf4rjna656@e107158-lin.cambridge.arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 29 Jul 2019 21:06:37 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/29/19 4:18 AM, Qais Yousef wrote: > 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? > Yes, the owner field is only used and defined when CONFIG_MEMCG is on. Cheers, Longman