Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp144334iob; Tue, 17 May 2022 21:45:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoLmc0Q2vqJLwwKgmdkEEZz0OHZS15wFABIU24Q5tsJ8Glcdq0QrQn3fraRwNKD0LS4z2N X-Received: by 2002:a17:902:b90b:b0:15f:bd0:18b5 with SMTP id bf11-20020a170902b90b00b0015f0bd018b5mr26062805plb.97.1652849100356; Tue, 17 May 2022 21:45:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652849100; cv=none; d=google.com; s=arc-20160816; b=AbuLRMq14OAUy+GKU7Dgh5aFF3JvzRa2gGCp2VMcF3mob309QZxF4pivP5qM35j+Nm xSmLcf7Q9FOsZI9vWWaJUPQ++hRTJEvlx/p8fthoWeYYFl/+7B5QGSRY5E6drkE6crNT SZK+Ob21bukJ83itb4dN1I1gXLewPvq8oQqYlHhVENxxY6Xq1n3ioovYmPCES8UCBOrG NyoWbSu/zQhu8gSbJvvLVYOiaJnTfH6hFvkpaAHdvklM4UVBKStWryBnOzBCe3AFyRwI FaVAbailNYsRX+Bk8TblJODiraiGoREAgVmh2ARXrjNdKdMRiiB3OGegzdjr5IomrhLH 342Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=J1KjVE0wHNwP3/mTNkJ0TblpbUqdNrFgJOI9ondDKTg=; b=eBmEFUfUsZ1HssUREEpRvDt4sVdqalcycREluyF61Huo6JORQ9DL0MdB074+s6O6yQ vS0eFPQM5TUad4H83xiAwa85XLe4VBXpsYGrv9n2uMwKwa+frVJoLYdrS9eyrS3Wu856 GF2fvL0OyOxShfEHVlfqlXIeQYvoyC2bNDU+HDhi8a7JP9bSCS94QxyxZyfNn7u7xhtC 4JsOErFCSkplLFMldRGcVUvewhwpMjlZvp3UcwLyH4sAwrDk0C/eVAshTqhWfi1DB6W8 kbLJDHjS9Qfp2WZu2GkYvm8Wt/4T7nDUHGU19ev2h91QH9PXbZX9GSnO1Al+BSm+0FGw fmNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=YUevUczA; dkim=neutral (no key) header.i=@suse.de; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 26-20020a17090a005a00b001df9bf8be88si1385775pjb.165.2022.05.17.21.45.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:45:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=YUevUczA; dkim=neutral (no key) header.i=@suse.de; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4C940DFF76; Tue, 17 May 2022 20:57:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241727AbiEQHha (ORCPT + 99 others); Tue, 17 May 2022 03:37:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241814AbiEQHft (ORCPT ); Tue, 17 May 2022 03:35:49 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 540CE48889; Tue, 17 May 2022 00:34:56 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0F0A4220E4; Tue, 17 May 2022 07:34:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1652772895; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=J1KjVE0wHNwP3/mTNkJ0TblpbUqdNrFgJOI9ondDKTg=; b=YUevUczAacH+9aLfJ9cL8rkSgdKZsoDdA5JzHX7uxPFz1UEnANG0qTEqGhdX1VQsWUZZYL 4FAWNpczOkRRX4jjyjpw4iF84Vzb0LAd2ilYeOiIJiIZ0cj5gN5Uroc20IXNrx1JEa6Fw5 DCobOFu3k/3n9hQi+4aoQBbGDFDL2+0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1652772895; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=J1KjVE0wHNwP3/mTNkJ0TblpbUqdNrFgJOI9ondDKTg=; b=f8ddPe5eIGU5Z3eU1wOrwxLWrE+9w35kzWYcySynKAyDzb0Ri6XNByG7zSiinsOLCBzw4/ SznTLHqPjf7/TvCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 383B613305; Tue, 17 May 2022 07:34:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id A6IECx5Qg2IGeQAAMHmgww (envelope-from ); Tue, 17 May 2022 07:34:54 +0000 Date: Tue, 17 May 2022 09:34:52 +0200 From: Oscar Salvador To: Muchun Song Cc: corbet@lwn.net, mike.kravetz@oracle.com, akpm@linux-foundation.org, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, david@redhat.com, masahiroy@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, smuchun@gmail.com Subject: Re: [PATCH v12 1/7] mm: hugetlb_vmemmap: disable hugetlb_optimize_vmemmap when struct page crosses page boundaries Message-ID: References: <20220516102211.41557-1-songmuchun@bytedance.com> <20220516102211.41557-2-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220516102211.41557-2-songmuchun@bytedance.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, May 16, 2022 at 06:22:05PM +0800, Muchun Song wrote: > If the size of "struct page" is not the power of two but with the feature > of minimizing overhead of struct page associated with each HugeTLB is > enabled, then the vmemmap pages of HugeTLB will be corrupted after > remapping (panic is about to happen in theory). But this only exists when > !CONFIG_MEMCG && !CONFIG_SLUB on x86_64. However, it is not a conventional > configuration nowadays. So it is not a real word issue, just the result > of a code review. > > But we cannot prevent anyone from configuring that combined configure. > This hugetlb_optimize_vmemmap should be disable in this case to fix this > issue. > > Signed-off-by: Muchun Song > Reviewed-by: Mike Kravetz > Acked-by: David Hildenbrand Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE Labs