From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E44EC433F5 for ; Mon, 11 Oct 2021 09:28:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6764F60F38 for ; Mon, 11 Oct 2021 09:28:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235495AbhJKJaO (ORCPT ); Mon, 11 Oct 2021 05:30:14 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:59302 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235430AbhJKJaM (ORCPT ); Mon, 11 Oct 2021 05:30:12 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id BE3FF20047; Mon, 11 Oct 2021 09:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1633944491; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bzsf3qOeWL3PJZQYXdzcM4qU33SyWkAIXshFGPaeTMM=; b=ued5v0sFSNMVPRllyFCfLUKZ95H22GdIvG2tAhbnjyPI3mp3TUAeKsc9XsNJdUEzzjCM6j PYxNHl2RWLDc5JPVwu+LykQC/sMPkYOyX7LJNeBgTQIpHlLkb8QEyNhpnRFA+mG/CNkUtk e3Ot+kBeVmoBBjgTuQLpu2iIh6B11EA= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 31155A3B8D; Mon, 11 Oct 2021 09:28:11 +0000 (UTC) Date: Mon, 11 Oct 2021 11:28:10 +0200 From: Michal Hocko To: David Hildenbrand 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 Subject: Re: [PATCH] mm: Free per cpu pages async to shorten program exit time Message-ID: References: <20211008063933.331989-1-ultrachin@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). A deferred and properly accounted context implementation is still lacking AFAIK. I have a vague recollection we have padata framework but I am not sure anybody has explored this to be used for the address space shutdown. IIRC Daniel Jordan was active in that area. -- Michal Hocko SUSE Labs