Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2192877rwr; Fri, 21 Apr 2023 05:51:39 -0700 (PDT) X-Google-Smtp-Source: AKy350ZI4oA2fZLkrT5G7HYgKvTHBDhpeVhHPc1EN6/bS756rlzWabf1g2vOh6bAYwONaY9bTdls X-Received: by 2002:a05:6a00:14cf:b0:63b:5257:6837 with SMTP id w15-20020a056a0014cf00b0063b52576837mr5658171pfu.1.1682081499267; Fri, 21 Apr 2023 05:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682081499; cv=none; d=google.com; s=arc-20160816; b=FMamj0n9hjq8AkYQjtqLcplqfXPOsPND/IoByyDUd7jjv6MALj5g2PaaYdmgWZwK0C MfPZmqDKBnq+P25YZ7NKkdN5m3XGR6s4GDyG4mU8SIA6TN8TzCp94n8hONROf+sd5h18 X936qQva/TFLVqzqI+R2irkGCVip6C7cXodxWgf4cS7Eh4FfPJnw5nRITpGdw/reY0nL V40GwBIHGFMtvilRf4ArBpuyflNOV7rE/zqnr1XGoXYeVu7sP6q9o0Ir52tVSQwhklA7 af4BddVU+6Mn8XsGqjDwyaSrgNanAGHAe18VyEcEhzN60xO5zJgNNPsi4PGNJX8CQbLS yv7Q== 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; bh=CvyFB6T8SYGfEZm0CErxhiJBypDCl00WwM8ysVRFH4s=; b=csPOQdeQWH73z6ZQKCkNHYPVYtyPgyjyBa34881ko8yqtrAWzg1SKKGswwBMe3SNcz MoLkaMLTcJqP9DNdWRpNsq7i4Z/R5vwyhbym1gXu8YX50h397WZeW+D7sKjtFJyB2dYV +bQx4hJyjG3mfYSa8ah1ClzubqpHMyFmghfiEscMkHLPK+qEMrrWoH2/6s8kQxZuyubN g/xMmOYY988JlQjkigXRVoZDNt+XLwYirwOgIHjGihBJIzvzkEuDk3exd5oFeQML5PsA uG2k9IvIazPhXk/Lldi4PtOF+TPXP+TdYHstfKi4K7aSrYbHpKdLgNR9uTLCLfAga6q5 RepQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 78-20020a621751000000b0063b8b7d7a14si4378300pfx.70.2023.04.21.05.51.27; Fri, 21 Apr 2023 05:51:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232236AbjDUMrv (ORCPT + 99 others); Fri, 21 Apr 2023 08:47:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232159AbjDUMru (ORCPT ); Fri, 21 Apr 2023 08:47:50 -0400 Received: from outbound-smtp37.blacknight.com (outbound-smtp37.blacknight.com [46.22.139.220]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 892E71B1 for ; Fri, 21 Apr 2023 05:47:48 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp37.blacknight.com (Postfix) with ESMTPS id 12AAB1FC1 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-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, 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 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