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=-2.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 82F1EC433E0 for ; Wed, 24 Jun 2020 17:22:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 41BAC2078D for ; Wed, 24 Jun 2020 17:22:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="bO8d8ywn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41BAC2078D Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A36B66B0003; Wed, 24 Jun 2020 13:22:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E78E6B0006; Wed, 24 Jun 2020 13:22:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83D8E6B0007; Wed, 24 Jun 2020 13:22:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0207.hostedemail.com [216.40.44.207]) by kanga.kvack.org (Postfix) with ESMTP id 660B06B0003 for ; Wed, 24 Jun 2020 13:22:18 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D1ECD824556B for ; Wed, 24 Jun 2020 17:22:17 +0000 (UTC) X-FDA: 76964773914.07.quiet50_270abf326e45 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id A44DE1803FFC1 for ; Wed, 24 Jun 2020 17:22:17 +0000 (UTC) X-HE-Tag: quiet50_270abf326e45 X-Filterd-Recvd-Size: 5576 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 17:22:16 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id b16so1420542pfi.13 for ; Wed, 24 Jun 2020 10:22:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=dJ5KB+Gu/y0HXzrbNal/8Fz/YZMw23nT5aHa08d1gN0=; b=bO8d8ywnBP6oYYnX756kuzko2y/h7DDizKX4hi++/3jbz98LGxPvlOqOg84EAz9+aZ wWr63jHB+8cpPm+07/CZpdFs9/pX0OdDScBcU4/WJNCeWOjLZJffSwl8jO9tparQoy9Z TwcF5neg3CypRSViS2TtDkJBi971zLJHAKCEvBd2I8QKIx85eOFSiMnZ8d6FjzglAaa+ hkgxRJm7sZ7QGOl7AbvZqDJiN12oZtvd3gky+kaUK4Rhwz4RxRRmfhT4bIsZa1LSI7dF sabDt14vzWH1GVbs84qJXla4hzJdOCXk/Q3Qs+8JuCmoVhoLCQ6VylLrGquNtw1aXhKh RZ7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=dJ5KB+Gu/y0HXzrbNal/8Fz/YZMw23nT5aHa08d1gN0=; b=COmXTc80ZkL3TkgrubxEzBo0LOQTKzi/h1J1JlCocWip+QS3+TCnOaJRjO9+N3EvuL bPAdM6ZcSKmvjypONvDV1tAkqIkybO34/6QxO+aAflrvyv9dPCBaPDQ1TEZipljMhEgN 550de86MhyvU3M/7dyO2idIl5jTdHumMzLG8rldIyTtMBf7ut+g5PrTWdlLGhCnW9WMV 7LuLibEPw9nOT2RaJ/2wLW4HUqLEUdSNq1Fcj+Q29gfne5i6W1FD2SN/Q4vabTFJKifX qJjwZ+CQ9qpvN2pT3TGrANzWkRg2WBYcaGjeQ2Vkymsk1E+ec3DJpYm6HkXVBe+zBy6U U4yw== X-Gm-Message-State: AOAM530HWM5+FskBAZBgcPc05UOCJLwMpBiUhsKeWrLWBhRJyRgcD6lV 6QkGLyAEi2nN0EWqXeqsnGn3/g== X-Google-Smtp-Source: ABdhPJyyPGo4foxBU9ueDFd5aywv2hvtdzkY+Q8uawM4+FTzrEiHryI/n56+hUEOobuQazIAYJU9bA== X-Received: by 2002:a63:d250:: with SMTP id t16mr9444781pgi.51.1593019335735; Wed, 24 Jun 2020 10:22:15 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id g21sm20249987pfh.134.2020.06.24.10.22.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 10:22:15 -0700 (PDT) Date: Wed, 24 Jun 2020 10:22:14 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: =?UTF-8?Q?=E5=AD=99=E4=B8=96=E9=BE=99_sunshilong?= cc: David Hildenbrand , linux-mm@kvack.org Subject: Re: Are there still some methods that could be used by the Linux kernel to reduce memory fragmentation while both CONFIG-MIGRATION and CONFIG-COMPACTION are disabled? In-Reply-To: Message-ID: References: <73b5db17-805a-4f1a-60f7-26695c0422e8@redhat.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1482994552-1714110388-1593019335=:261553" X-Rspamd-Queue-Id: A44DE1803FFC1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.001833, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1482994552-1714110388-1593019335=:261553 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 24 Jun 2020, =E5=AD=99=E4=B8=96=E9=BE=99 sunshilong wrote: > >> Are there still some methods that could be used by the Linux kernel > >> to reduce memory fragmentation while both CONFIG-MIGRATION > >> and CONFIG-COMPACTION are disabled? > > > > > >We do have mobility grouping on pageblock order. > >Also, I think you can use ZONE_MOVABLE without migration and compactio= n, > >to at least locally limit unmovable fragmentation. > It's a good news. >=20 > Could you please explain that in more detail for me or suggest some doc= uments > for me to go through. >=20 /proc/buddyinfo and /proc/pagetypeinfo will show the various pageblocks o= n=20 the system. Grouping pages by mobility simply means that we attempt (bes= t=20 effort) to allocate unmovable pages from the same pageblocks and movable=20 pages from the same pageblocks. > As per the post(http://lkml.iu.edu/hypermail/linux/kernel/1703.1/06782.= html), > I think it's something like ZONE_NORMAL. And I find that > "ZONE_MOVEABLE" is available on Linux-v4.9. >=20 Yes, you can use kernelcore=3D (or movablecore=3D) on the kernel command = line=20 to set this up: allocations from this zone must have __GFP_MOVABLE so the= y=20 "should" be migratable. This is typically only useful when=20 CONFIG_COMPACTION is enabled, however, to do that defragmentation work so= =20 that higher order memory becomes available. > Is there some potential problems that I should be aware of if I enable > "ZONE_MOVABLE" on real-time system? >=20 Yes, if ZONE_MOVABLE is made too big then you can risk out of memory=20 kills: movable allocations can fallback to ZONE_NORMAL but unmovable=20 allocations cannot graduate to ZONE_MOVABLE. So if ZONE_NORMAL is full=20 (either because you have too much unmovable memory in-use or too much=20 movable fell back to ZONE_NORMAL), and you have more unmovable=20 allocations, you'll get reclaim in ZONE_NORMAL and, at worst case, oom=20 kills. --1482994552-1714110388-1593019335=:261553--