Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp306477rwn; Wed, 14 Sep 2022 21:34:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6g2t/FjUvR5oJTJdr1ZD2NVOe902FICqx7Q7QGOj10/I3BI0AA40pi76NVUc4odBjwUeSO X-Received: by 2002:a17:903:32c2:b0:178:2ca7:fade with SMTP id i2-20020a17090332c200b001782ca7fademr2413844plr.71.1663216465612; Wed, 14 Sep 2022 21:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663216465; cv=none; d=google.com; s=arc-20160816; b=nqELJ3WCDKNslGwpOmOVxHE+e7MJB/whIarDOhnDCsN1OTm1H7ruuw2bElYBZPZizF kSxy2sTxBs2Jkn7B3l0ABT1iBT5nBdl6h+8xPwBzSHOtuSBFZmdsZ1YHuB+ETz5PBG2O Idc1ylsHhHZTg2UjV/KLc81JX2AnrINdatwoCWGpz8SV/6cujjWT67MmEqZhdyhlv02k sDFT9gHw8DfWSYjuFtHru49YfiN9sxElhdL7nXgM6C6s6vGeX69g/Oo8mXI0hOin/Mb4 YSrkWJ7VvL4uFHoH01VrUbc8V6omuzEMgWknjm0kG5zzgHLOQ8SkuOoHWn0qnteTR5DJ uF4A== 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=Rp2hb7jsVkIpo1uaIkf2AqZV7igkV0nPtVBey4vQ3iA=; b=I0ZAWftjo6ZuSUu4i7/z+XojDAD45BJPFwwP7IZjUuW+6HymGsK7XHoDOBoNXQmZti 7u9KH+PHPtsKVZQhuqf3mmSfthmpG9SJIPGuiMxIT85+Dl+GtFi9ZtXh657Hv2IJGNvZ LqvJzUcuFpo1cQVu/kfZg6AON4ErU9XDyJVP2qIu8PLcsBjdnOdud6uTc0+Cq7pd2Yfx dTwaggH4BjnLtIiyVgM5T5DsZPCQgijPwhWiiRkFxGenHZn/91IAAWjLZHYC7TVinfLl vGa3R7BIVaTwYinLn3UlPmqZFbj3QZBE53z47SU2+Oa2kFOAnB6vAnywWQcBy5Vsdn7H q3vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=heSGgyWH; dkim=neutral (no key) header.i=@suse.de header.b=V7JIYzWA; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j8-20020a63cf08000000b0041cb4f8c278si18025206pgg.555.2022.09.14.21.34.09; Wed, 14 Sep 2022 21:34:25 -0700 (PDT) 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=@suse.de header.s=susede2_rsa header.b=heSGgyWH; dkim=neutral (no key) header.i=@suse.de header.b=V7JIYzWA; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbiIOEYw (ORCPT + 99 others); Thu, 15 Sep 2022 00:24:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiIOEYt (ORCPT ); Thu, 15 Sep 2022 00:24:49 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E74920F4C; Wed, 14 Sep 2022 21:24:45 -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 1F43D34234; Thu, 15 Sep 2022 04:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1663215884; 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=Rp2hb7jsVkIpo1uaIkf2AqZV7igkV0nPtVBey4vQ3iA=; b=heSGgyWHzuf3rMoxxqD2XF0OwMvMrOesmZZaVvvPtZ3cxmqQQMI3AHyJ65Sk5SdK9iPLka zZ2V85Ei9YcD44YLDVhzdz0JN7ixC0FS4ov5fdk8PInEo4rOqZG0SjZZKhuio317HI/Bzh ts9TyxzYSVnBjMyvLuvIx7bdIl6QYRE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1663215884; 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=Rp2hb7jsVkIpo1uaIkf2AqZV7igkV0nPtVBey4vQ3iA=; b=V7JIYzWAv7lP7/23sPcdYKdxyOxAIlqEZGrIoKT4zXukt6sMBBsM/mQ1b6xzjCAb7QNopS HfxwHUoFtxyIeHAw== 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 A248D139C8; Thu, 15 Sep 2022 04:24:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HVX4JAupImMkJgAAMHmgww (envelope-from ); Thu, 15 Sep 2022 04:24:43 +0000 Date: Thu, 15 Sep 2022 06:24:41 +0200 From: Oscar Salvador To: Doug Berger Cc: Mike Kravetz , Muchun Song , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] mm/hugetlb: correct demote page offset logic Message-ID: References: <20220914190917.3517663-1-opendmb@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220914190917.3517663-1-opendmb@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, 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 Wed, Sep 14, 2022 at 12:09:17PM -0700, Doug Berger wrote: > With gigantic pages it may not be true that struct page structures > are contiguous across the entire gigantic page. The nth_page macro > is used here in place of direct pointer arithmetic to correct for > this. > > Fixes: 8531fc6f52f5 ("hugetlb: add hugetlb demote page support") > Signed-off-by: Doug Berger > Cc: Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE Labs