Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2419042pxp; Mon, 7 Mar 2022 15:11:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4bNVHabJ+7/pNo9QK2jP/Msnll6TmLZcOHeW6pMrc1ls7wd02D0c7DH3f1bug/sMNvszp X-Received: by 2002:a50:da8b:0:b0:415:a122:d7ad with SMTP id q11-20020a50da8b000000b00415a122d7admr13320550edj.123.1646694687440; Mon, 07 Mar 2022 15:11:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646694687; cv=none; d=google.com; s=arc-20160816; b=aD6ThVjK3c7fEjAetjvpwQnHGQdibNoohX5nw/gQlFqzO0DgTdIaC0c7siyEc+tOwW 5fzNcm1UU/M5k6Q3ZBooRhKj6iOnbHoOekTnvx4qtroCynizWc1jvNccGPoqG6Zp7sSc dyyFxKMgm8Gq4Z4frWA05BgoAz1tc7Gtk1WgZS6zObRFgR0xoWoQ9qyhofC8zNCfbQxm L+de4ZCvG2sewkPbNtSubgUgPDJosWV/MuUOm/12ewBUe5ScyLwc+o2DHZKKYHfirA75 6G+wB3bsnIDNFOK/jKDfmZe/NcFoNSwXWAcE0JQMubS7yKwMzfRNhEfDvHch3o+lFpFR qEEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=tEpagJj9t2o6OBo2LyfR78mC1PBCzGopqSpUCsiMZj8=; b=duxQ4bR4mh8mlRo8XTN4P1CV6nF2KW2nIGFJ92+/MrP+8dEfSmt/3sRNsukIxZSWOH pxIF7jZuRDowGpoVAKBjg4/q6YKkrpdlq2Rgb1QBHmQHA9TduFZt8gRbX02AgahV4jk2 pjmp/jche7OsyjDtmh4uO17D+NqhNhIJEPgcxLZVjT6VeRWT5Q3nNKcdPiFpLVS0imrW lMiIsj/QmzM/sIM5tKIlhxb0m6BuKtAav4L2lrTSQSLspYUR3mVbKMop9EDL3MUzc2MP O14JqBakqw4S3Yi5+a7bEe6ZdviTHozomvhfV5ucEkJlakEGEMt4ogt44zqEVNhiGwdI Q/ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=mgLq5vWc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a50d48a000000b004159e5da055si9044842edi.508.2022.03.07.15.11.05; Mon, 07 Mar 2022 15:11:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=mgLq5vWc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244228AbiCGQgU (ORCPT + 99 others); Mon, 7 Mar 2022 11:36:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236323AbiCGQgT (ORCPT ); Mon, 7 Mar 2022 11:36:19 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1214B8A6F1; Mon, 7 Mar 2022 08:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tEpagJj9t2o6OBo2LyfR78mC1PBCzGopqSpUCsiMZj8=; b=mgLq5vWcrbHbqiR1CIRlDBbC1g vM1ubvNcbK3M8PCoJWLMzo3gSOluj7/rCcw7pLHRPVO860CDISJ6STa1uly8hoktHdm2uPe1uDcFC 3Ak/yIdl+4Bh6iy5AKiLZYxzj7fANOYl7ZFaZJDwOoj5FJpNHPg04sUzOqPo9IScToRtej51OxplV 2jQLJv4FGmTSRL/SErTy/dFT8pFGBQ7Z1j+/b3flYSsmUbGbbsaymgQUSITK6kMIhElaugocayadJ BnU+2agxFd9yLoTqG4llKUBSA0FiOnGWX0R26bvNANdmvRHI/s1ucv8GvgwIlGuj9h/HXP2wGtT3F rcharuow==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRGKI-000r2h-Pq; Mon, 07 Mar 2022 16:35:14 +0000 Date: Mon, 7 Mar 2022 08:35:14 -0800 From: Luis Chamberlain To: Muchun Song Cc: corbet@lwn.net, mike.kravetz@oracle.com, akpm@linux-foundation.org, keescook@chromium.org, yzaikin@google.com, osalvador@suse.de, david@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, smuchun@gmail.com Subject: Re: [PATCH v3 1/4] mm: hugetlb: disable freeing vmemmap pages when struct page crosses page boundaries Message-ID: References: <20220307130708.58771-1-songmuchun@bytedance.com> <20220307130708.58771-2-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220307130708.58771-2-songmuchun@bytedance.com> Sender: Luis Chamberlain X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 07, 2022 at 09:07:05PM +0800, Muchun Song wrote: > If the size of "struct page" is not the power of two and this > feature is enabled, then the vmemmap pages of HugeTLB will be > corrupted after remapping (panic is about to happen in theory). Huh what? If a panic is possible best we prevent this in kconfig all together. I'd instead just put some work into this instead of adding all this run time hacks. Can you try to add kconfig magic to detect if a PAGE_SIZE is PO2? Luis