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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D192C54EBC for ; Tue, 10 Jan 2023 14:13:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 975C28E0003; Tue, 10 Jan 2023 09:13:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 925BC8E0001; Tue, 10 Jan 2023 09:13:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7ED6E8E0003; Tue, 10 Jan 2023 09:13:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 701CE8E0001 for ; Tue, 10 Jan 2023 09:13:46 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 32CD9140706 for ; Tue, 10 Jan 2023 14:13:46 +0000 (UTC) X-FDA: 80339082852.19.D980670 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf27.hostedemail.com (Postfix) with ESMTP id C929F4000C for ; Tue, 10 Jan 2023 14:13:43 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="D9r/xeRV"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf27.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673360024; h=from:from:sender: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:dkim-signature; bh=dk/dNQqfUg5Dp5tZLEaiDx8F6N8JCYwAfOK3J2qiqk0=; b=XzKf/F3ZTZG8Dg0Ka5oFA57c0w+BF2u4i9/x/27PyUOoiVZDYRPQ5Q3OAisMNCAivMjcGY 0JXooh2yS3YzhmininwMXsSuO1EvKheI+OEHbmb141dcIAteHIUNS9f+21/IbPDVJvzmKc cYoIvxcO3Zo99Hcr9lZYJHuzqcUyXac= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="D9r/xeRV"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf27.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673360024; a=rsa-sha256; cv=none; b=rcXA5WzbTRzRpRpwO8df9dElyRlARKzS9S3X/hXKUu2QbertVn7Jq5XHlAMRDAccg7MKIC 0G0NYv17H9QycvcOoh973pNMcYyAQbsJ5b5JyNQ4uyy4Wl7+jZBTvO/0pdVnRu8po8TbZ2 qIR0Si1HUibGgoQJbeTYeV7PbowK/Us= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673360023; 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=dk/dNQqfUg5Dp5tZLEaiDx8F6N8JCYwAfOK3J2qiqk0=; b=D9r/xeRVbarAXAzOJkOPYoSMYQZxBH44BK5KIWCOuWc/JL0oefm9+ynmGXOkKpzRofl5Xo w/fH7X1alfzY3DVTQfglcPOptddFvyI4i6DiC0uld+qEVSLzbP/3iZ9NxK1L/lBgE92+lD Emb3XmYx/b/IvIeVPGk3DVqG2X7u878= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-297-9-PLZXawPNWe03bAdAed3Q-1; Tue, 10 Jan 2023 09:13:39 -0500 X-MC-Unique: 9-PLZXawPNWe03bAdAed3Q-1 Received: by mail-wm1-f69.google.com with SMTP id n9-20020a05600c3b8900b003d9f14e904eso3095759wms.9 for ; Tue, 10 Jan 2023 06:13:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dk/dNQqfUg5Dp5tZLEaiDx8F6N8JCYwAfOK3J2qiqk0=; b=7SynRDN20XirBoWh9BbYAc/FXX2gxB4czuCoimTFo/cTsQO3W2PKIsH8AoLbFGJOTP xMXRPY/496Zv5/OnugJQDj0ty1UkK8fZ06w4vtbFUlm6ZPq0/MDV7a6XSlTm0CDkGZIg m+0nZmGcZg/JTtpVMdegTLHUC+7x4piURHwjLBn5K5q4eTczVMiV3lQMKQh/YL5XdORp sTTLUczTglp8OoX9tZGzr+1tL/HVZi480OCS2uDL28Yxatx1IB9U+JVvVlrM+IydzRfg nkcjN5VR6En6OKiAVNFMoTkUNVeqxEQzjGYSKjzduWYOT0fz0PumDN+LquD1w4hPXrxo BEfQ== X-Gm-Message-State: AFqh2kpU3pxuovcEq5Coz86biehHK1E0zMLHjTIPqgZl4BMtGiMu/OA7 kp1gMz3HGfpYeWg/FrmfFoWagO+Gmt0QAv+4YPp+EofIQvDykTri2FzrfrXa/RfUZ6oZ4k06w24 W3PuKtOGjX00= X-Received: by 2002:a05:600c:1d2a:b0:3d3:50b9:b1a1 with SMTP id l42-20020a05600c1d2a00b003d350b9b1a1mr53095314wms.1.1673360018798; Tue, 10 Jan 2023 06:13:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXusItbuLfkaGbtwVJJipRVrGsD0K1AgwwFSDznRwuJCrYHCPiDhKOXakMuSwSvBvwuGE9ENXQ== X-Received: by 2002:a05:600c:1d2a:b0:3d3:50b9:b1a1 with SMTP id l42-20020a05600c1d2a00b003d350b9b1a1mr53095300wms.1.1673360018545; Tue, 10 Jan 2023 06:13:38 -0800 (PST) Received: from ?IPV6:2003:cb:c708:4200:65d9:4d0d:bb61:14c8? (p200300cbc708420065d94d0dbb6114c8.dip0.t-ipconnect.de. [2003:cb:c708:4200:65d9:4d0d:bb61:14c8]) by smtp.gmail.com with ESMTPSA id h15-20020a05600c314f00b003d99469ece1sm20944282wmo.24.2023.01.10.06.13.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Jan 2023 06:13:38 -0800 (PST) Message-ID: <589145ce-49f4-5b4c-bdef-ef400f27903f@redhat.com> Date: Tue, 10 Jan 2023 15:13:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 To: Matthew Wilcox Cc: Yin Fengwei , linux-mm@kvack.org, akpm@linux-foundation.org, jack@suse.cz, hughd@google.com, kirill.shutemov@linux.intel.com, mhocko@suse.com, ak@linux.intel.com, aarcange@redhat.com, npiggin@gmail.com, mgorman@techsingularity.net, rppt@kernel.org, dave.hansen@intel.com, ying.huang@intel.com, tim.c.chen@intel.com References: <20230109072232.2398464-1-fengwei.yin@intel.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [RFC PATCH 0/4] Multiple consecutive page for anonymous mapping In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C929F4000C X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: zw6cddrrhamr7o5fg148uur6jomfni13 X-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RaZR9CzzcfoCVYGZdDX3NNVAaSo46RAVZtblCqrSiNDu8YHca5w6mcxvp/MvXZH7cSukHt2HO8P3Dw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 09.01.23 20:11, Matthew Wilcox wrote: > On Mon, Jan 09, 2023 at 06:33:09PM +0100, David Hildenbrand wrote: >> (2) This steals consecutive pages to immediately split them up >> >> I know, everybody thinks it might be valuable for their use case to grab all >> higher-order pages :) It will be "fun" once all these cases start competing. >> TBH, splitting up them immediately again smells like being the lowest >> priority among all higher-order users. > > Actually, it is good for everybody to allocate higher-order pages, if they > can make use of them. It has the end effect of reducing fragmentation > (imagine if the base unit of allocation were 512 bytes; every page fault > would have to do an order-3 allocation, and it wouldn't be long until > order-0 allocations had fragmented memory such that we could no longer > service a page fault). I don't believe that this reasoning is universally true. But I can see some part being true if everybody would be allocating higher-order pages and there would be no memory pressure. Simple example why I am skeptical: Our free lists hold a order-9 page and 4 order-0 pages. It's counter-intuitive to split (fragment!) the order-9 page to allocate an order-2 page instead of just "consuming the leftover" and letting somebody else make use of the full order-9 page (e.g., a proper THP). Now, reality will tell us if we're handing out higher-order-but-not-thp-order pages too easily to end up fragmenting the wrong orders. IMHO, fragmentation is and remains a challenge ... and I don't think especially once we have more consumers of higher-order pages -- especially where they might not be that beneficial. I'm happy to be wrong on this one. > > Splitting them again is clearly one of the bad things done in this > proof-of-concept. Anything that goes upstream won't do that, but I > suspect it was necessary to avoid fixing all the places in the kernel > that assume anon memory is either order-0 or -9. Agreed. An usptream version shouldn't perform this split -- which will require more work. -- Thanks, David / dhildenb