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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1492C433FE for ; Mon, 18 Oct 2021 07:44:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 71631610A3 for ; Mon, 18 Oct 2021 07:44:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 71631610A3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id F2DD16B006C; Mon, 18 Oct 2021 03:44:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EDD0B6B0071; Mon, 18 Oct 2021 03:44:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCB776B0072; Mon, 18 Oct 2021 03:44:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id D05296B006C for ; Mon, 18 Oct 2021 03:44:43 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 60DEE181DF774 for ; Mon, 18 Oct 2021 07:44:43 +0000 (UTC) X-FDA: 78708771246.27.1C3891B Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf01.hostedemail.com (Postfix) with ESMTP id 6A0215082D56 for ; Mon, 18 Oct 2021 07:44:39 +0000 (UTC) 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 7A87721A6B; Mon, 18 Oct 2021 07:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634543081; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uRitaSdTVQaJHWkcEYYfsZh1e5H5O4Y2u6C6EN9RHZw=; b=gUoGOZZobYJpoYjwU2IYPymMA2YuQ+2qgz7MpnioolDyxfQi34gjYGErciu7THulCvDIqH E7qmjTjvluoTqPaG4qvEl19HG8kMSL6uyXSBA/+xPDdly7aws8Gi9L8GNw+9p5mYyMAd4V djR7gC7CKd0VOHwEq/c5fpRQ7D+qZ2o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634543081; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uRitaSdTVQaJHWkcEYYfsZh1e5H5O4Y2u6C6EN9RHZw=; b=fIfevUhOPCPCtiqRALZ1/X9QKxZrhIYuKH49E96y7E0LnvrY8Z1tbgxJtHXE3fpRTpSYki Fq56TopyYm6xSyBA== 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 504DD13CC9; Mon, 18 Oct 2021 07:44:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wgNzEuklbWFDFgAAMHmgww (envelope-from ); Mon, 18 Oct 2021 07:44:41 +0000 Message-ID: <11b2fa69-ebcf-fec4-73e5-51ada24c5aaf@suse.cz> Date: Mon, 18 Oct 2021 09:44:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Content-Language: en-US To: Kent Overstreet , David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, linux-raid@vger.kernel.org, linux-block@vger.kernel.org, axboe@kernel.dk, alexander.h.duyck@linux.intel.com, David Rientjes References: <20211013160034.3472923-1-kent.overstreet@gmail.com> <20211013160034.3472923-2-kent.overstreet@gmail.com> From: Vlastimil Babka Subject: Re: [PATCH 1/5] mm: Make free_area->nr_free per migratetype In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=gUoGOZZo; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=fIfevUhO; dmarc=none; spf=pass (imf01.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 6A0215082D56 X-Stat-Signature: tckin74zzrgdijsew9p7t6pohxdsupxg X-HE-Tag: 1634543079-595217 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 10/14/21 16:45, Kent Overstreet wrote: > On Wed, Oct 13, 2021 at 06:33:06PM +0200, David Hildenbrand wrote: >> > @@ -9317,6 +9319,7 @@ void __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn) >> > struct page *page; >> > struct zone *zone; >> > unsigned int order; >> > + unsigned int migratetype; >> > unsigned long flags; >> > >> > offline_mem_sections(pfn, end_pfn); >> > @@ -9346,7 +9349,8 @@ void __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn) >> > BUG_ON(page_count(page)); >> > BUG_ON(!PageBuddy(page)); >> > order = buddy_order(page); >> > - del_page_from_free_list(page, zone, order); >> > + migratetype = get_pfnblock_migratetype(page, pfn); >> >> As the free pages are isolated, theoretically this should be >> MIGRATE_ISOLATE. > > Thanks for noticing that - I somehow missed the fact that pageblock migratetypes > change at runtime, Not only that. Buddy merging will also merge pages from different migratetypes. I think that's the main reason why nr_free is not per migratetype. Your patch has been attempted few times already, e.g. here [1]. [1] https://lore.kernel.org/all/alpine.DEB.2.10.1611161731350.17379@chino.kir.corp.google.com/ > so my patch is wrong. I'm going to have to rework my patch to > store the migratetype of free pages in the page itself. Yeah that would be the solution. Will likely bring some overhead to alloc/free fastpaths, which would have to be worth it, so nobody attempted it.