From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECABA78F40 for ; Tue, 7 Jan 2025 16:35:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736267754; cv=none; b=AniKj+Po1t/fBQWUEmoogSNNgxsoVlMczOFaxtdomamQY0Ymjq90PP6LpECGXJZb2+LmJW8u6SPWDwJl/pIyKCjlS0C1VWTGb8wcK/AEqt6L573gRfkAyhcaVe3VjhOoFI8+mDPxc0ReTEoey80G3g+tnccAjYR/qYnRk2c0S/8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736267754; c=relaxed/simple; bh=RPq6fjj4qMLW3DvViH9muzG0Xt+5Zla/9NP9YyXHhns=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ka1rhI7hHeH7X6/f/n2ELymkbmtu5ndG/2F0iFXUmzlz74Yhrn8ReRDt4ZbztfCmWPEsB/TQZ9PTo6eFijhdSvLFnScW9o6/XEJIoZUe6WCinqFIpKQb1r39a2Q780SFagfN4Jpw9UZDU9YQ+NbItmyqQ5Y7ubCYSUb0lRHE7qg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=nuobgzPa; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="nuobgzPa" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=IfXyUN//EO14AUeaSIe/1h1uG+5ZNzUWmDofQ5asGwE=; b=nuobgzPaOGDoJVNr6IeCiWo10i Ry1cq8Osfu6gs5uJckGRwQ7DKaa+L8Qx4L/tSF31pTpr7XqRdyXyYJ5ktCBFlC2RMURXchyxtx3iq OHp634FhscgZhoUjU8PEFW0VbZRHlCteTKW6C3z+xkiJP29Cz8FSkOpN0b7hYAea+df67MFUmjU9Y K9UpJOo+fHkgAaMLsHwQ14e51r78p6LF1oh6xeHzL4tVyWpQe8607QJnCmrEpHziUJP7qmoWZI3O1 GkSHFuTVXm6J3odHyvXZ5GaF0kAyucRDH01bprQIWAVJG3mBZttUTwXW/AgoCTO/eG0v5SujErR+r 1S3GsRHg==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tVCYW-00000008FlJ-2TSc; Tue, 07 Jan 2025 16:35:48 +0000 Date: Tue, 7 Jan 2025 16:35:48 +0000 From: Matthew Wilcox To: David Hildenbrand Cc: Yu Zhao , Andrew Morton , Mateusz Guzik , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Will Deacon Subject: Re: [PATCH mm-unstable v1] mm/hugetlb_vmemmap: fix memory loads ordering Message-ID: References: <20250107043505.351925-1-yuzhao@google.com> <85ea0bc9-0892-489d-b42b-430ff8a1f368@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <85ea0bc9-0892-489d-b42b-430ff8a1f368@redhat.com> On Tue, Jan 07, 2025 at 09:49:18AM +0100, David Hildenbrand wrote: > > +++ b/include/linux/page-flags.h > > @@ -212,7 +212,7 @@ static __always_inline const struct page *page_fixed_fake_head(const struct page > > * cold cacheline in some cases. > > */ > > if (IS_ALIGNED((unsigned long)page, PAGE_SIZE) && > > - test_bit(PG_head, &page->flags)) { > > + test_bit_acquire(PG_head, &page->flags)) { > > This change will affect all page_fixed_fake_head() users, like ordinary > PageTail even on !hugetlb. I've been looking at the callers of PageTail() because it's going to be a bit of a weird thing to be checking in the separate-page-and-folio world. Obviously we can implement it, but there's a bit of a "But why would you want to ask that question" question. Most current occurrences of PageTail() are in assertions of one form or another. Fair enough, not performance critical. make_device_exclusive_range() is a little weird; looks like it's trying to make sure that each folio is only made exclusive once, and ignore any partial folios which overlap the start of the area. damon_get_folio() wants to fail for tail pages. Fair enough. split_huge_pages_all() is debug code. page_idle_get_folio() is like damon. That's it. We don't seem to have any PageTail() callers in critical code any more.