Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1441294pxb; Mon, 11 Oct 2021 06:10:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhbSfTdu2pxuqGd1OngQJFO1wv5ZP6Sysp7gZ6eKGHnghSFPOnnTSpTfEQvJb3D27EU1B2 X-Received: by 2002:a05:6402:7:: with SMTP id d7mr42120498edu.265.1633957824051; Mon, 11 Oct 2021 06:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633957824; cv=none; d=google.com; s=arc-20160816; b=TGGAwP8SpJg2q0iTcpq2h3KQZ0NYORbRoj5CdjLkPEGpWS9bTtgAZUOdv5jH+h71K1 XN8fCzN0AjeesVlWH/4yyh04JAkP6uObp1zS3zozdZqOvdhPHuWxwI5lCQUCtS92mFOQ iblSXlqq8kWKSt4ZQCipvvhO7UdiWbCLPRwX5yQQxDTPW+C/0H5OKDAWv+G++NkPCsPq +vQNIfq6R8Kf7ex2Hy3Z36/L/Mhd/2T8kVlj8Yz7Nl2TJuDThDAVsvWtJrFhNkeGA88Q bCjXQ5dD7IfWUhQL0X4QlKZeQB/9mdMISegiI1v4CKHd0sVn2Vh+wnU8w8zLih4ijQL/ T8EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=Nvm/qex5O1o/iUk7v0jlAEBgI/qIYmJudO2T4n06fHw=; b=zrIFYJGauJ72E7TW4fFgzQLFkGJiz7ek1oa8Z+ZkE4SuuSUTHwEIAjceBNnnWyNbGL 1ESLBj027t3YOt5PYnhir8gW1qcSgXy7XJmsT6N4uQ/VMO/AsYbw/8UdSZYy0QqsRDnK iqxZsam+5TfzQp56y7OKccCL7kdSvXoNDsO3MNUptZSe5V1wde/bjAIgYu/5qft3DPkz /fsVUHE/5rZdCP5ELX67JhIia7+I1myQ8sHp8fIYRQJF898GodYVI+OWRrelCIsM4Y1K wHqMRzpYI5Jj8/Nk0giftEXekPtNH21+dCW0aDzO/KaMN9nrRr9gBu69fMH5F4r1bUWg cNyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Yy87L9GO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t16si8037230ejt.525.2021.10.11.06.09.35; Mon, 11 Oct 2021 06:10:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Yy87L9GO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235574AbhJKJmS (ORCPT + 99 others); Mon, 11 Oct 2021 05:42:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27219 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235500AbhJKJmQ (ORCPT ); Mon, 11 Oct 2021 05:42:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633945216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nvm/qex5O1o/iUk7v0jlAEBgI/qIYmJudO2T4n06fHw=; b=Yy87L9GOelgf+y0eddyNRdZsH8PejzraP3JlBCOs51W/0gMvT3TEmnbuvEnjPMBGwHkBzL Sex0Kp8s0p+EtWv/g7ExT5pyDh3fX7UNmAzwFDB+01+Apj9rxwKw6x3NO7C5Df8GTlXqlM +/y0y2GR5QZcZIqBlG5qK5zmqqyYSE0= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-519-QlUU8msMOReSeflVvIpM6w-1; Mon, 11 Oct 2021 05:40:15 -0400 X-MC-Unique: QlUU8msMOReSeflVvIpM6w-1 Received: by mail-wr1-f70.google.com with SMTP id j19-20020adfb313000000b00160a9de13b3so12831988wrd.8 for ; Mon, 11 Oct 2021 02:40:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Nvm/qex5O1o/iUk7v0jlAEBgI/qIYmJudO2T4n06fHw=; b=qlHvKAKGBxPk/HlLUhCORATlKkEJqMPAzXBLeo5D+tq/slneXra/kZPJ9RLsWVBhod Oh0VIUvcswBZjkxxyc3VhN/QbwCgUI4k6aamSV27FYl1UDN4uYLGNCFkR7fwZrdKN5mr 89uVGFeQdYuYT5K2kbhud88K1gzf3f3zE4WV9nIV9H6Bgnkc/7zG3TpRwtR1f5Mqvs6x 2MK5albJ5PaRFSoCQuCNnHYna3ohNV8BZh1k05YFL9JEM0sZC0MEYEShQhqIMnXB4UrO CPQgEPVCDgXrJnUJ3/32nTTf1Ir65TjKJv77C2s/dbD01BBHQeyKEiRHopLey5B3GfuV /bcg== X-Gm-Message-State: AOAM533ftPDH1W2FL5/5/vYw/3xUnIihp/cGJ1jGjTuqUYMnAz0yNhhW D0L9zcRHMNFcPIz0LocyrH2zP8OWmQj6Cy+Xdr+8lMNWRA63wtmUFB/Yl934fqWc/2VOywXshsz b+C/Bq3GTIN/N0anblWzigU3V X-Received: by 2002:a1c:4c17:: with SMTP id z23mr20209652wmf.61.1633945213835; Mon, 11 Oct 2021 02:40:13 -0700 (PDT) X-Received: by 2002:a1c:4c17:: with SMTP id z23mr20209632wmf.61.1633945213663; Mon, 11 Oct 2021 02:40:13 -0700 (PDT) Received: from [192.168.3.132] (p5b0c64ba.dip0.t-ipconnect.de. [91.12.100.186]) by smtp.gmail.com with ESMTPSA id v23sm7087848wmj.4.2021.10.11.02.40.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Oct 2021 02:40:13 -0700 (PDT) Subject: Re: [PATCH] mm: Free per cpu pages async to shorten program exit time To: Michal Hocko Cc: ultrachin@163.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, brookxu.cn@gmail.com, chen xiaoguang , zeng jingxiang , lu yihui , Claudio Imbrenda , Daniel Jordan References: <20211008063933.331989-1-ultrachin@163.com> From: David Hildenbrand Organization: Red Hat Message-ID: <278a6cda-3095-5e27-e136-2765f73bc67d@redhat.com> Date: Mon, 11 Oct 2021 11:40:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11.10.21 11:28, Michal Hocko wrote: > On Fri 08-10-21 10:17:50, David Hildenbrand wrote: >> On 08.10.21 08:39, ultrachin@163.com wrote: >>> From: chen xiaoguang >>> >>> The exit time is long when program allocated big memory and >>> the most time consuming part is free memory which takes 99.9% >>> of the total exit time. By using async free we can save 25% of >>> exit time. >>> >>> Signed-off-by: chen xiaoguang >>> Signed-off-by: zeng jingxiang >>> Signed-off-by: lu yihui >> >> I recently discussed with Claudio if it would be possible to tear down the >> process MM deferred, because for some use cases (secure/encrypted >> virtualization, very large mmaps) tearing down the page tables is already >> the much more expensive operation. >> >> There is mmdrop_async(), and I wondered if one could reuse that concept when >> tearing down a process -- I didn't look into feasibility, however, so it's >> just some very rough idea. > > This is not a new problem. Large process tear down can take ages. The > primary road block has been accounting. This lot of work has to be > accounted to the proper domain (e.g. cpu cgroup). In general, yes. For some setups where admins don't care about that accounting (e.g., enabled via some magic toggle for large VMs), I guess this accounting isn't the major roadblock, correct? -- Thanks, David / dhildenb