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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B7F7C7618E for ; Fri, 21 Apr 2023 12:47:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 14D516B0071; Fri, 21 Apr 2023 08:47:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0FE2F6B0072; Fri, 21 Apr 2023 08:47:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F2E8B6B0074; Fri, 21 Apr 2023 08:47:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E3A676B0071 for ; Fri, 21 Apr 2023 08:47:50 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A47E81203AD for ; Fri, 21 Apr 2023 12:47:50 +0000 (UTC) X-FDA: 80705375100.21.CF14D79 Received: from outbound-smtp29.blacknight.com (outbound-smtp29.blacknight.com [81.17.249.32]) by imf17.hostedemail.com (Postfix) with ESMTP id C8B3E40020 for ; Fri, 21 Apr 2023 12:47:48 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf17.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.32 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682081269; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CvyFB6T8SYGfEZm0CErxhiJBypDCl00WwM8ysVRFH4s=; b=JCQ4WvH1730CpMiQ1JHel5XZIzbJFBAqZXWT7Y5+9gGg05HkjbyJo2HVuBTgB7P27NVnEu xRE6/ydTBkri9lv2R7aiL768gJZouRvz6WjwT09X4cFMTnRjM9diE2eM/xu9o9FDkjW48w 44Ydl6iexMcla0OKWfkxUzhXQTe/X5o= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf17.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.32 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682081269; a=rsa-sha256; cv=none; b=rMiGNJ5KVyCGJoAWtXMNDczC2tiqXDsoa2naKs06GOTG9qLF/WIupwYc/Mig678llDuAYM I55s7iOggzy94gSfh0zkJ5zI1gOP7+npbhYo1ujli9FkGJVJpK0/LR1omxf8dfzp6cPV95 bHNrlnlVFpIRQcvMg8o/dhDgXhtYq2Y= Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp29.blacknight.com (Postfix) with ESMTPS id 0CAE5BED87 for ; Fri, 21 Apr 2023 13:47:47 +0100 (IST) Received: (qmail 20574 invoked from network); 21 Apr 2023 12:47:46 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.21.103]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 21 Apr 2023 12:47:46 -0000 Date: Fri, 21 Apr 2023 13:47:44 +0100 From: Mel Gorman To: Johannes Weiner Cc: linux-mm@kvack.org, Kaiyang Zhao , Vlastimil Babka , David Rientjes , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [RFC PATCH 05/26] mm: page_alloc: per-migratetype pcplist for THPs Message-ID: <20230421124744.skrxvziwg3bx7rgt@techsingularity.net> References: <20230418191313.268131-1-hannes@cmpxchg.org> <20230418191313.268131-6-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20230418191313.268131-6-hannes@cmpxchg.org> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C8B3E40020 X-Stat-Signature: km3jfcbz9zr1wo9wyoy9zuezz8yccizx X-HE-Tag: 1682081268-333794 X-HE-Meta: U2FsdGVkX1/fM0TxCaM+o2S/Jtb9zKMV/BFeQ/Ua6ktN7WUiJlNhNRVqSGc2dTuDaU2Ogsvi6OVNN5+iHSNqR1Pd4xNYKmbRhUtsLayEcXsbLjBeCaecqSVoHI0M2RvsFheUYns0MkoQzf4k3PNVlmy2x4FBebfN904BJq1nJCbDyOPfrWKIbsvikbay3S0klL0yfrjZhi6y6hBRcLItGyANpb8Wr+JkpSXNQPVDECl/FCgoUkIqSWlwO6WVNWA06+zTfvZkz9DTHWqJ/I7JlNaXsuMCJjGGe3Ek6f9cim334z+FxNEFv0RfKTe4qaNtQTZ/n0Tt+otd3CbiyucvrQzmMqjmfyz502f6CLkbVqh8Qy54UoMSIa6OPJEab+Iv7+ZmmJZ150Yn8gfV1tqTuzunWf6nUm7Y16TtLoo4aIUcXKpsx3Hv3u6YVCIO9txZSZytarn6cZjEtBcl5xxT5Tra5Rwg9FlaKel2qQmdM2smBVBcOXBgFL6gD6Fl1JH4OVH9ID+An+5agZRDLw3PTan/Xqc1MbGYdOhXo9aM7obM0PJhhiJDqolIGqYYTs+E5F5MaO0Xxu60ekn+a9mTrx9En4A7L29wUaX750L38OmqY/8ZB/n+paNWFzW/pLId2+Xoau3UZz2TzVRBE4rPwHP0klOGNqOH8tdg6eL/NP8/gVjHYEWpvSrOCYFPEUGV/arxzQw97EwEroRxtVMbyS9VYwohxOusRmKMZw8MrOgn2tKr75mM4YApxo0Bh1X4PgZrIlnv9dMe8brGZk5TLZuRq4Bf1YkwU3bz3FsMj6bbm/tf2mppy9LCN1vCMk4vnQwd2XPTwXT8+PJmia4/Ze8WQOvTYPfsNUuLaQH4sNRX+phrjfwnDos9eodlBjyPmd3UB7wIkGOmyY0ryHdJtvGwRs1Nh11P+F1IzZDzhJF/iLhr2iG6vP9cyIfzBsbGOWyNVQpkzprfFXdWYCI qFd2iBFF vlku5lky+C+lrhwoppJVHVcARawt5+mEvoDVgh8/XMZYyx69BaSTgJ3qu8T6VneWFm7LeOhVbB08XS7s0DsX4wU2qkyjnKvJpmk++JPYtweP4UXr/xEd7zTxEXA7qf9t+S02JR+CydsBEuupe/2rQKBK7PfJfrKN5yBgfZWuYWZhxc9jZFyRBlP5CR9ff9sxkq/WPXRfWDxNMPbu8SB4pRfGW2rmSrpj4U9JKuZScqen1r8SlCDPbHJCtYMG+szYcmYkF668z8sN0Gik= 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 Tue, Apr 18, 2023 at 03:12:52PM -0400, Johannes Weiner wrote: > Right now, there is only one pcplist for THP allocations. However, > while most THPs are movable, the huge zero page is not. This means a > movable THP allocation can grab an unmovable block from the pcplist, > and a subsequent THP split, partial free, and reallocation of the > remainder will mix movable and unmovable pages in the block. > > While this isn't a huge source of block pollution in practice, it > happens often enough to trigger debug warnings fairly quickly under > load. In the interest of tightening up pageblock hygiene, make the THP > pcplists fully migratetype-aware, just like the lower order ones. > > Signed-off-by: Johannes Weiner Split out :P Take special care of this one because, while I didn't check this, I suspect it'll push the PCP structure size into the next cache line and increase overhead. The changelog makes it unclear why exactly this happens or why the patch fixes it. The huge zero page strips GFP_MOVABLE (so unmovable) but at allocation time, it doesn't really matter what the movable type is because it's a full pageblock. It doesn't appear to be a hazard until the split happens. Assuming that's the case, it should be ok to always set the pageblock movable for THP allocations regardless of GFP flags at allocation time or else set the pageblock MOVABLE at THP split (always MOVABLE at allocation time makes more sense). -- Mel Gorman SUSE Labs