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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_RED 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 D7679C11F64 for ; Thu, 1 Jul 2021 18:26:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5C0E26141F for ; Thu, 1 Jul 2021 18:26:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C0E26141F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 790908D02B1; Thu, 1 Jul 2021 14:26:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 73FD58D0001; Thu, 1 Jul 2021 14:26:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B9B48D02B1; Thu, 1 Jul 2021 14:26:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id 378F98D0001 for ; Thu, 1 Jul 2021 14:26:09 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E45991820C795 for ; Thu, 1 Jul 2021 18:26:08 +0000 (UTC) X-FDA: 78314848416.28.6834E00 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by imf24.hostedemail.com (Postfix) with ESMTP id 86F47B000099 for ; Thu, 1 Jul 2021 18:26:08 +0000 (UTC) Received: by mail-lf1-f43.google.com with SMTP id a11so13425152lfg.11 for ; Thu, 01 Jul 2021 11:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JBoBayL33cw9iKNS64XOIcWjPQDnw5eR3JSYkQC/+/Q=; b=EZkYlhCfYNOE4Hf9ipMoyOd2r439szD3t/ZJdiZFkrA6LDyKjK0ji0BN+fQa1nGC/T OqTaajiz/53/hUiZc+xUtTOxl34CMl5ql6/3RbSG5cvjeGjIrS3LJYo4JwaguJirhMty GBUBCJ6sDujgylrC8NycqTs/QjID+yzqg9hhI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JBoBayL33cw9iKNS64XOIcWjPQDnw5eR3JSYkQC/+/Q=; b=e7coAgnOyy2v2s3EH2O3Mqq9ng5uHIaY1carVayyCkln9cS30lwKWz2oJk/bUZ5pAb hhISco5KCr8953jNaX5xsZ/wvF1OblXFyGVfna/q2pg49OcsZnqAV98e0ey8Y60Uo6Fr 4f6cZyfFwSK9aGHqbd5UVnpgoQs7UmaWZBpAn2lhSdWB4VN5VDt/f5FQFdckPgHkY50m A+uijj9lh9TL7TV7gg2GqB0EXMUD3gGNQ0fFUCwW70U04uThq7d4cFbH8ig/t8abnLH0 OWs6olaHZewmwmfyiPd7aWz2aOhkyBigowUANVqm/p3EoZVh65dNVtl/uIjjQY1jzLTu iCYA== X-Gm-Message-State: AOAM531E9TITPe/9V3D9iuDG9uNc5t1BUjDB0N3I82ZcPqwRUFP86K50 7JvEupWE2EEWCU6p3VqqRaa4pkZAO70ZVyhhqzk= X-Google-Smtp-Source: ABdhPJywTM9zdr70CcLoAoBCnGaopEuUfFDClixXKjRjNad5YpO0WkKQ1P0bMP6LDaoX3KsGy+o2Mg== X-Received: by 2002:a19:6714:: with SMTP id b20mr749161lfc.449.1625163966495; Thu, 01 Jul 2021 11:26:06 -0700 (PDT) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id p18sm89962ljj.56.2021.07.01.11.26.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 11:26:05 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id k21so9783548ljh.2 for ; Thu, 01 Jul 2021 11:26:04 -0700 (PDT) X-Received: by 2002:a2e:9f11:: with SMTP id u17mr706019ljk.48.1625163964601; Thu, 01 Jul 2021 11:26:04 -0700 (PDT) MIME-Version: 1.0 References: <20210630184624.9ca1937310b0dd5ce66b30e7@linux-foundation.org> <20210701014713.b42x8Nm1B%akpm@linux-foundation.org> In-Reply-To: From: Linus Torvalds Date: Thu, 1 Jul 2021 11:25:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [External] Re: [patch 004/192] mm: hugetlb: free the vmemmap pages associated with each HugeTLB page To: Muchun Song Cc: Andrew Morton , Mina Almasry , Anshuman Khandual , "Bodeddula, Balasubramaniam" , Borislav Petkov , "Singh, Balbir" , Chen Huang , Jonathan Corbet , Dave Hansen , David Hildenbrand , Xiongchun duan , Peter Anvin , Joao Martins , Joerg Roedel , Miaohe Lin , Linux-MM , Andrew Lutomirski , Michal Hocko , Mike Kravetz , Ingo Molnar , mm-commits@vger.kernel.org, =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= , oneukum@suse.com, Oscar Salvador , "Paul E. McKenney" , Pawan Gupta , Peter Zijlstra , Randy Dunlap , David Rientjes , "Song Bao Hua (Barry Song)" , Thomas Gleixner , Al Viro , Matthew Wilcox Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=EZkYlhCf; spf=pass (imf24.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.43 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Stat-Signature: 11bbshr5s9u4i7eas7i6s8cd7oybofnt X-Rspamd-Queue-Id: 86F47B000099 X-Rspamd-Server: rspam06 X-HE-Tag: 1625163968-858356 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 Wed, Jun 30, 2021 at 11:30 PM Muchun Song wrote: > > On Thu, Jul 1, 2021 at 11:46 AM Linus Torvalds > wrote: > > > > Anyway, this HugeTLB 'struct page' vmemmap patch-series doesn't look > > _wrong_ to me, but it does look like it is a nightmare to debug if > > something ever goes wrong. And it looks like a lot of things _could_ > > go wrong. It all looks very subtle. > > In order to make things work well, some addresses of vmemmap are > also mapped with read only to catch invalid usage from other modules > (e.g. write operation). I didn't get the point of "a lot of things _could_ go > wrong". Would you like to describe the details? Thanks. I just worry about the subtlety. Things like "oh, now I can't free the page because I need allocations for the mapping pages" is a very new condition for hugetlb pages. And if the page table mapping ever gets out-of-sync, debugging it sounds nightmarish. The real horror: missed TLB invalidates or things like that, where even if the page tables themselves updated, the CPU actually uses something else. So I didn't see any bugs, but honestly, while I read through all the patches that was really just that: "reading patches". I just want people to be very ready to revert, because I suspect that any potential bugs will just result in very subtle behavior problems. Linus