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 75D02C433F5 for ; Mon, 11 Oct 2021 09:40:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 121C460F43 for ; Mon, 11 Oct 2021 09:40:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 121C460F43 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8A0276B006C; Mon, 11 Oct 2021 05:40:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 85058900003; Mon, 11 Oct 2021 05:40:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 717F7900002; Mon, 11 Oct 2021 05:40:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0042.hostedemail.com [216.40.44.42]) by kanga.kvack.org (Postfix) with ESMTP id 642CE6B006C for ; Mon, 11 Oct 2021 05:40:19 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1E54A27708 for ; Mon, 11 Oct 2021 09:40:19 +0000 (UTC) X-FDA: 78683660958.31.831365C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf19.hostedemail.com (Postfix) with ESMTP id BA7E7B00244C for ; Mon, 11 Oct 2021 09:40:18 +0000 (UTC) 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-339-L_yH_o7AO2SpKpP_rfzBZw-1; Mon, 11 Oct 2021 05:40:14 -0400 X-MC-Unique: L_yH_o7AO2SpKpP_rfzBZw-1 Received: by mail-wr1-f70.google.com with SMTP id h11-20020adfa4cb000000b00160c791a550so12637109wrb.6 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=Uir0r+9ANTOMeRQeXDgzrKhGp6ZZj0lizALjzjBF8DOyl7ek8gra5bNw7RSelkU4+S PIE67d2FEV5uSpmKaLiT1LsWk0zONfKeF1l0smR0UYkkl6wicVu2VCLBaGkZ13zNUeqr OeDN4RgXaKKJaRLo4Buwtjwqsm/inmViDT677G/Nq8SzoaFKiPEloeWQkASucJv3EtFC 36OJYwcmscIR3zBU1RCl95CGNNZzudqGVKDl/jT4GCUYCgnAKUGUFoHBLhYjQtYs+XDy fkMNgh+2dCxJidiRLh2cefrisJNir+46NBzcQvQj4yfeEAO3t8aGFSkzaI2xiG1GYSLj +TjQ== X-Gm-Message-State: AOAM530e5haogJZ/PWRDePJL0CupfsKoFb3E2RUZP6qOrLN5T8b+0jsv OtXp0GgixmJIDt8TxZJLMTr1a7cwdKIQsg5m4gPjVG/kf41b+Q8aQZS2VcJm6i88C0Y/nbqPoak QNl0lA9rr3CE= X-Received: by 2002:a1c:4c17:: with SMTP id z23mr20209661wmf.61.1633945213862; Mon, 11 Oct 2021 02:40:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbwaJB797an2sMAZ7pQoYzSQIrEcgcM7naLW3zaJiRPSrzLO96YOx+/YJBwMe6cq4fgXMd2g== 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: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Yy87L9GO; spf=none (imf19.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: BA7E7B00244C X-Stat-Signature: shpim8fdjf5bc7fqa6euujnopufchqix X-HE-Tag: 1633945218-12946 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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