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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1996C433B4 for ; Mon, 26 Apr 2021 08:37:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 510ED60C3F for ; Mon, 26 Apr 2021 08:37:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 510ED60C3F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A27146B006C; Mon, 26 Apr 2021 04:37:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9AEAE6B006E; Mon, 26 Apr 2021 04:37:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D9D46B0070; Mon, 26 Apr 2021 04:37:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0210.hostedemail.com [216.40.44.210]) by kanga.kvack.org (Postfix) with ESMTP id 55D286B006C for ; Mon, 26 Apr 2021 04:37:30 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0A78A485C for ; Mon, 26 Apr 2021 08:37:30 +0000 (UTC) X-FDA: 78073864260.01.BE047AF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf10.hostedemail.com (Postfix) with ESMTP id EC71740002C4 for ; Mon, 26 Apr 2021 08:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619426249; 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=TVK0IPAL1uPYo6BCuSzx6+CPPnrHCxq19TPjpGS3x4Y=; b=gf5BTqTGOIRzg94FHWLiwJRVpqeXHvRGQmzrpXxR0TIIfM2Uy/gcp/kuTAZcYujYstUk3E WEayJVN5GKUnLvcK0AWHKFCFP5khz6zFWP7NnRlhyvAIRFdCwzEd9x43SRdUNzKpjpk2xn YeLJQ7CHVOEU2UL5ySnC4cjr0QTehWQ= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-489-OeZ3gINPNkmJ-lSIYGAdHg-1; Mon, 26 Apr 2021 04:37:26 -0400 X-MC-Unique: OeZ3gINPNkmJ-lSIYGAdHg-1 Received: by mail-wm1-f72.google.com with SMTP id j6-20020a05600c1906b029014119fce11cso226960wmq.6 for ; Mon, 26 Apr 2021 01:37:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=TVK0IPAL1uPYo6BCuSzx6+CPPnrHCxq19TPjpGS3x4Y=; b=B+rJGIVg4UVZiHFKo+mg/Kj4+Jk0Gy2iAoSN3ovwrnL0Ix7Co9PpGjp7B2EJd628V+ nYEqTgLGL5yAEAZDmqNOtpTmWNgRmrn54h5UhHwhJX8mvVZf35CIp5MAe51WWYo53vv9 5sSirv1w1RLuA7HUWhUI/DcIQkF4sWN3vIkRE5PEX+SH0HJ2LLV8iOOu8VwKflafKhTj 4ZaH9yp7+XfeXcLNORc8tkfukIDCTf0DHDL/uopq/O6YYF9m452ZSM60VUI77501lX6v E2n7PsAzgXe0ndKGQxCYy5Vt6TnW0K3CIzxaWRnIRVjjar728BOHCUMv43/ljEvR7JNe GJoA== X-Gm-Message-State: AOAM531olYVArhKr1tIMMwld739xGOsjIzdpzWE3VafhQ2OBuiGlMj30 gzlict1f9W9GL+ibukZFnoZclAIV5spoLuPVI+qUyV4CVfA9+Np7Crb85KkvQSohNS8wDLU2bOu hpEArKau/VUPZBSFxK1RlrQk4HS6Dh2iTPE4ji/V7yWf5a2lpSI9Lao7ix8s= X-Received: by 2002:a5d:4a87:: with SMTP id o7mr733960wrq.102.1619426245055; Mon, 26 Apr 2021 01:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzveJEJgPS8uJcPeDtRzMtd4yu2f4jgK70PX1DUHn1wSnFqh6X3/NpXTd7BIXqmfq0SNhe1Ig== X-Received: by 2002:a5d:4a87:: with SMTP id o7mr733914wrq.102.1619426244734; Mon, 26 Apr 2021 01:37:24 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6206.dip0.t-ipconnect.de. [91.12.98.6]) by smtp.gmail.com with ESMTPSA id 3sm6752968wms.30.2021.04.26.01.37.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Apr 2021 01:37:24 -0700 (PDT) To: "lipeifeng@oppo.com" , Vlastimil Babka , peifengl55 , schwidefsky , "heiko.carstens" , zhangshiming , zhouhuacai , guoweichao , guojian Cc: linux-s390 , linux-kernel , linux-mm References: <20210414023803.937-1-lipeifeng@oppo.com> <2021042611194631963076@oppo.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [RFC] mm: support multi_freearea to the reduction of external fragmentation Message-ID: <7dcc87f5-9ae5-613a-0cf4-820334592b90@redhat.com> Date: Mon, 26 Apr 2021 10:37:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <2021042611194631963076@oppo.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: EC71740002C4 X-Stat-Signature: soj8k1jgpbc9s95rh3tm3sj4ojxcez4m Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf10; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619426239-1212 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 26.04.21 05:19, lipeifeng@oppo.com wrote: >=20 > >> Let's consider part 3 only and ignore the 1) multi freearea (which = might > >> be problematic with sparcity) and 2) the modified allocation scheme > >> (which doesn't yet quite sense to me yet, e.g., because we group by > >> mobility and have compaction in place; I assume this really only he= lps > >> in some special cases -- like the test case you are giving; I might= be > >> wrong) > >> Right now, we decide whether to but to head or tail based on how li= kely > >> it is that we might merge to a higher-order page (buddy_merge_likel= y()) > >> in the future. So we only consider the current "neighborhood" of th= e > >> page we're freeing. As we restrict our neighborhood to MAX_ORDER - = 1 > >> pages (what we can actually merge). Of course, we can easily be wro= ng > >> here. Grouping by movability and compaction only helps to some degr= ee I > >> guess. > >> AFAIK, what you propose is basing the decisions where to place a pa= ge > >> (in addition?) on a median_pfn. Without 1) and 2) I cannot complete= ly > >> understand if 3) itself would help at all (and how to set the > >> median_pfn). But it would certainly be interesting if we can tweak = the > >> current logic to better identify merge targets simply by tweaking > >> buddy_merge_likely() or the assumptions it is making. >=20 >=20 >=20 > Hi David Hildenbrand=EF=BC=8CVlastimil Babka: > =C2=A0 =C2=A0 Thank you very much indeed for advices. >=20 >>> 2) the modified allocation scheme > >> (which doesn't yet quite sense to me yet, e.g., because we group by > >> mobility and have compaction in place; I assume this really only he= lps > >> in some special cases -- like the test case you are giving; > =C2=A0----------------------------------------------------------------= ----------------- > 1) Divide memory into several segments by pages-PFN > 2) Select the corresponding freearea to alloc-pages > =C2=A0 =C2=A0 These two parts art for the same purpose: > low-order-pages allocation will be concentrated in the front area of=20 > physical=C2=A0memory > so that few memory-pollution in the back area of memory, the sussessful= =20 > probablity > of high-order allocation would be improved. >=20 > =C2=A0 =C2=A0 I think that it would help in almost all cases of high-o= der-pages=20 > allocation, instead > =C2=A0 =C2=A0 of special case, because it can let more high-order free= -pages in=20 > buddy, example: See, and I am not convinced that this is the case, because you really=20 only report one example (Monkey) and I have to assume it is a special=20 case then. >=20 > * when user alloc 64K bytes, if the unit is page(4K bytes) and it > needs to 16 times.=20 >=20 > if the unit is 64Kbytes, it only takes once. >=20 > * if there are more free-high-order-pages in buddy that few > compact-stall in >=20 > alloction-process, the allocstall-time would be shortened. >=20 > =C2=A0 =C2=A0 We tested the speed of the high-orders-pages(order=3D4 a= nd order =3D 8)=20 > allocation > after monkey and found that it increased by more than 18%. >=20 And you don't mention what the baseline configuration was. For example,=20 how was compaction configured? Just to clarify, what is monkey? Monkey HTTP server? MonkeyTest disk benchmark? UI/Application Exerciser=20 Monkey? > 3) Adjust the location of free-pages in the free_list >>>Without 1) and 2) I cannot completely > >>understand if 3) itself would help at all (and how to set the median= _pfn) > -----------------------------------------------------------------------= ------------------------------ > =C2=A0 =C2=A0 Median_pfn is set by the range of pages-PFN of free_area= . if part=20 > 3) would be=C2=A0tried separately > =C2=A0 =C2=A0 without 1) and 2), the simple setting is the median of t= he entire=20 > memory. But i think it will play the > better role in optimization based on the 1) and 2). >=20 >=20 >=20 > >> Last but not least, there have to be more benchmarks and test cases= that > >> proof that other workload won't be degraded to a degree that people > >> care; as one example, this includes runtime overhead when >>> allocating/freeing pages. > --------------------------------------------- > 1. For modification of buddy: the modified allocation scheme 1)+2) > =C2=A0 =C2=A0 Is thers any standard detailed test-list =C2=A0of the mo= dified=20 > allocation in the community? like benchmarks > or any other tests? if =C2=A0i pass the test required by communiry that= can=20 > proof the patch will not degraded > to a degree that people care and can merge it in the baseline? IIRC, there are plenty. One example is will-it-scale. Have a look at https://github.com/intel/lkp-tests.git --=20 Thanks, David / dhildenb