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 27EA5C636D7 for ; Thu, 23 Feb 2023 09:07:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 983DD6B0072; Thu, 23 Feb 2023 04:07:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9339D6B0073; Thu, 23 Feb 2023 04:07:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D45C6B0074; Thu, 23 Feb 2023 04:07:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6A1CE6B0072 for ; Thu, 23 Feb 2023 04:07:44 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 08B321612A7 for ; Thu, 23 Feb 2023 09:07:44 +0000 (UTC) X-FDA: 80497978848.13.C943A89 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf14.hostedemail.com (Postfix) with ESMTP id C050E100007 for ; Thu, 23 Feb 2023 09:07:40 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=If5UPxq6; spf=pass (imf14.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677143261; 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=E/BAL2p+AIRztx0whTYatHzYBA8FlxWN8hYeshAkNjI=; b=VQbWAhtBLuYwnVrqj8I2qliqWRkK9Q0svUuWgl41eDYyaUuqdRhAA76T7gEXoSHAJb2L5c 46MscttTUUjv2r0Wkb9iG2XBtOD3C6gEDGiC7ZYpNDixV/ICQou0v0V5lklrBCp0SDCeQi Wm/mlFbi8G01eBlX8/MU+1gFBR2bpZM= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=If5UPxq6; spf=pass (imf14.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677143261; a=rsa-sha256; cv=none; b=lKOFMzrakQc9yaWlE1pcGXJe5Bd9Anq1boR+2NnnTphxJ/zVnxLiQlOGEWyZN6eH+3E31J 3J60hGwdtpAX4UOxnkbAqrwR4OSDHiv1SBc78zgCWAHB2QuvGpz24Wi3/JqnxWL+n6jjjQ b38p0kyOZ8zOYsXxVAvkGFeiR0H9yAI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677143260; 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=E/BAL2p+AIRztx0whTYatHzYBA8FlxWN8hYeshAkNjI=; b=If5UPxq6+37Q2ReRzeFETJTgRvz9zzXZhqNGtoPyUE48skgI3471ifM6iQUAE0xEnBVcK/ VfSkEJ93/n4nwFrwjaYNoOMYCONh0A/rspnfUyVagf3lQ7/wIc6YK9IMIbzNmtq08t1Khf Xwdu6yvc8qL+/zHG71cSKesX+L7oiQE= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-597-CAwpdhTRNHekI6mqt73-Xw-1; Thu, 23 Feb 2023 04:07:38 -0500 X-MC-Unique: CAwpdhTRNHekI6mqt73-Xw-1 Received: by mail-wm1-f72.google.com with SMTP id bi27-20020a05600c3d9b00b003e9d0925341so1305108wmb.8 for ; Thu, 23 Feb 2023 01:07:38 -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:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E/BAL2p+AIRztx0whTYatHzYBA8FlxWN8hYeshAkNjI=; b=KkhPNx31Npie7RBWCYy8k9lztwu/GX9LsDWeLfzxbnsRZpdxCvLoBXnx/qaZ+JIwsX g3qYGK4qeKu4CqVCqKEUhhAlKxG7K/v6K9mye2Ynl22PCWzb5ZeFUpX0ZAgusIgKjxzH OaZo2Jdfp36hHZ7ytYBNxoa5Uj8F5YFI2+fWsqeWLkW1Bx/RW7lJp+MB3ruMsaIapTqP jZwEt/aZXXO26TjqQauuFdOzgv79dG0E6Vt1xHFq75fR9YzqFAfY4vf3JhTOoR0WZA9F U9Ua7Kv25wEXZBT6ZNk/AJjXviugjEFzj8xWzIneiNbuBDMxWxRPa5hb9wbHVr2Q+4GD kjAA== X-Gm-Message-State: AO0yUKU8loZrBjGJeg5s/+VficTYtoT9H/DsSzNFtaZVpCY+S+EGGlRn 2Z/VaC/amlcyW9b2zDv1vaVDAnmuVBfxIkYBKXY4IX4SWL5TjewLiaGysiRt2439GJsq5tbG9dY K7ig/ndV3NLY= X-Received: by 2002:a05:600c:328a:b0:3dc:50bc:da70 with SMTP id t10-20020a05600c328a00b003dc50bcda70mr7957857wmp.10.1677143257502; Thu, 23 Feb 2023 01:07:37 -0800 (PST) X-Google-Smtp-Source: AK7set9RfY0vcBnPlzesx2HPB/lwsM3Xewi6Cu7IlK2PdBhnzLKimFGqKFnsMpy3GzL7gL20mRDDag== X-Received: by 2002:a05:600c:328a:b0:3dc:50bc:da70 with SMTP id t10-20020a05600c328a00b003dc50bcda70mr7957827wmp.10.1677143257112; Thu, 23 Feb 2023 01:07:37 -0800 (PST) Received: from ?IPV6:2a09:80c0:192:0:5dac:bf3d:c41:c3e7? ([2a09:80c0:192:0:5dac:bf3d:c41:c3e7]) by smtp.gmail.com with ESMTPSA id 15-20020a05600c22cf00b003e11f280b8bsm11307836wmg.44.2023.02.23.01.07.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Feb 2023 01:07:36 -0800 (PST) Message-ID: <94a10407-ebcb-7090-ef92-2bbc9416d6fa@redhat.com> Date: Thu, 23 Feb 2023 10:07:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH v2 00/46] hugetlb: introduce HugeTLB high-granularity mapping To: Mina Almasry Cc: Mike Kravetz , James Houghton , Muchun Song , Peter Xu , Andrew Morton , David Rientjes , Axel Rasmussen , Zach O'Keefe , Manish Mishra , Naoya Horiguchi , "Dr . David Alan Gilbert" , "Matthew Wilcox (Oracle)" , Vlastimil Babka , Baolin Wang , Miaohe Lin , Yang Shi , Frank van der Linden , Jiaqi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20230218002819.1486479-1-jthoughton@google.com> <28a7208c-939c-19ea-1cf0-298444dffe85@redhat.com> From: David Hildenbrand Organization: Red Hat 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: C050E100007 X-Stat-Signature: j166ch1cufqeyyxun5a1tugj1hpbnm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g6Kbp/4szWepuZFzx9KL9I07MQI3Djf6gphYlDwPaDKmDBgZ13aEQg8qD8PIHnhwNo1EqRKyUn983NyrgWVQueAPGVQAolkimdv4BiJDICwI9NTY08oainCEiGEZgRBUw/AwmpzZ4cwCQTQifRJR8nV0KlO31zD4euKRp3nBLiH1zJio9Y+XdHcu9V79LASj22U2lnhCvfBCxbtOcvPK5gPhdPhSZ4JOHlLx5XZVq9ZwVQhmeEOuFLCOCyXkiEOeOQqTJoFFNEJHir/GlErMXXgx1761B0B1nMcM29j2Cmt64Zu7NOgiMGvFlfXEOj037f3Ed/xsQ2nTzDf/bYBsvcxAiJHOENcpG7yw7RutWR4/M3EwJyAI8nG+CbPUHjCf4lfXyxI9B+YZGiCmeJcVmi4V1VhcDxkKLiD3aLoMXzVRVgvUCF0jgXNwLkz+nRTkLWnwBau6uwmZkdTYxsUQfsSVPB/m 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 22.02.23 21:57, Mina Almasry wrote: > On Wed, Feb 22, 2023 at 7:49 AM David Hildenbrand wrote: >> >> On 21.02.23 22:46, Mike Kravetz wrote: >>> On 02/18/23 00:27, James Houghton wrote: >>>> This series introduces the concept of HugeTLB high-granularity mapping >>>> (HGM). This series teaches HugeTLB how to map HugeTLB pages at >>>> high-granularity, similar to how THPs can be PTE-mapped. >>>> >>>> Support for HGM in this series is for MAP_SHARED VMAs on x86_64 only. Other >>>> architectures and (some) support for MAP_PRIVATE will come later. >>>> >>>> This series is based on latest mm-unstable (ccd6a73daba9). >>>> >>>> Notable changes with this series >>>> ================================ >>>> >>>> - hugetlb_add_file_rmap / hugetlb_remove_rmap are added to handle >>>> mapcounting for non-anon hugetlb. >>>> - The mapcounting scheme uses subpages' mapcounts for high-granularity >>>> mappings, but it does not use subpages_mapcount(). This scheme >>>> prevents the HugeTLB VMEMMAP optimization from being used, so it >>>> will be improved in a later series. >>>> - page_add_file_rmap and page_remove_rmap are updated so they can be >>>> used by hugetlb_add_file_rmap / hugetlb_remove_rmap. >>>> - MADV_SPLIT has been added to enable the userspace API changes that >>>> HGM allows for: high-granularity UFFDIO_CONTINUE (and maybe other >>>> changes in the future). MADV_SPLIT does NOT force all the mappings to >>>> be PAGE_SIZE. >>>> - MADV_COLLAPSE is expanded to include HugeTLB mappings. >>>> >>>> Old versions: >>>> v1: https://lore.kernel.org/linux-mm/20230105101844.1893104-1-jthoughton@google.com/ >>>> RFC v2: https://lore.kernel.org/linux-mm/20221021163703.3218176-1-jthoughton@google.com/ >>>> RFC v1: https://lore.kernel.org/linux-mm/20220624173656.2033256-1-jthoughton@google.com/ >>>> >>>> Changelog: >>>> v1 -> v2 (thanks Peter for all your suggestions!): >>>> - Changed mapcount to be more THP-like, and make HGM incompatible with >>>> HVO. >>>> - HGM is now disabled by default to leave HVO enabled by default. >>> >>> I understand the reasoning behind the move to THP-like mapcounting, and the >>> incompatibility with HVO. However, I just got to patch 5 and realized either >>> HGM or HVO will need to be chosen at kernel build time. That may not be an >>> issue for cloud providers or others building their own kernels for internal >>> use. However, distro kernels will need to pick one option or the other. >>> Right now, my Fedora desktop has HVO enabled so it would likely not have >>> HGM enabled. That is not a big deal for a desktop. >>> >>> Just curious, do we have distro kernel users that want to use HGM? >> >> Most certainly I would say :) >> > > Is it a blocker to merge in an initial implementation though? Do > distro kernel users have a pressing need for HVO + HGM used in tandem? At least RHEL9 seems to include HVO. It's not enabled as default (CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON not set), but compiled in so it can be runtime-enabled. Disabling HVO is not an option IMHO. Maybe, one could make both features compile-time compatible but runtime-mutually exclusive. Or work on a way to make them fully compatible right from the start. -- Thanks, David / dhildenb