Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1181331lqe; Mon, 8 Apr 2024 00:38:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWd01fEKZzVQAX0NPJWGylULyCrgL+WADjrZPg2WAA0GJy1K15Mif2UiQr7R5S1dJCUQ9QQol8ENSbkLUCZwZOzjaWcRSTDmJXgHYw2xg== X-Google-Smtp-Source: AGHT+IHt33TkVRSWSzKZvQ60MO14oi19YjqD9Cio7ItNdFH3jlPtz1hiq3vx+qcekTtsYqGD6D+i X-Received: by 2002:aca:2215:0:b0:3c5:f365:16cb with SMTP id b21-20020aca2215000000b003c5f36516cbmr2740461oic.37.1712561912347; Mon, 08 Apr 2024 00:38:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712561912; cv=pass; d=google.com; s=arc-20160816; b=T9eZC5UqNSaFtmaj/rmc95PB/kRnx7sjxPJ7CvITWlAJyVl884HRsbbNvUcApUCX3G 6J15hozPfj3ToTXpBR13jKrffAf5i9o9K8kaLG4mZTe9WSiDtkyuJC1mhBLtsT+yUnbJ skauGyL8+Hpw0QcrQEwejEGfogc0i1NjlIacAIIxokCVjOW0GxXnOdgH3dVGiOXusS+y yf3u9L2V6kgt8vZ39E/KWvOmpwuT128soWZa3d4j8MCbXSTmVpuoLBtEcTKH8GYvnDL8 1C8TPtccOSsDDJJ+ANhgEcuYtGvm036bBatyOblLSfkGWGGOcF1cJ5m6UQeVAIAhcKhS FWeg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=yDXYZ+HVnjL8LE33ELw6Ev7L7ptFfBFSiqjfmx+pLTk=; fh=Xio8HhsC3VD/CzeCGpBaGkH8TJP6ODESgvBVruEav8o=; b=V6J450YB2l+ph+B2KtD8MCAG6DU+24NJD9Wahp+fHkS5NEypDdP3q7Ug0xbWYr4yq0 XxFejkKN3GaWijfqDbHdTWNChz3dZXstuXnJkelGTYvqhdGHU19SuXxuDWkEe4I+HEoQ WS5jtP6YexGWeuvWI+vO4UFlkhdN/02EAJ6Q+cvEAxj+1LyO37+Jx11+vsnsu/Vl9EtR 62TV28fl2OqrDzRA0A8EKJ30xEpCpx4CgMb3yXpIpRfFc84WlfLk2mL/5Fi2fkvturaO pt/2viS/4CaagFVXQ8btR16ivIDHvc+E54pfW3Rin3skHuL5H/PdJbmg17qkUnTNv3z2 V9WA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=fBn2188k; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=fBn2188k; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-134911-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134911-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n189-20020a6327c6000000b005d8bb95ce76si5794613pgn.285.2024.04.08.00.38.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 00:38:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134911-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=fBn2188k; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=fBn2188k; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-134911-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134911-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0041D283AC9 for ; Mon, 8 Apr 2024 07:38:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37DDC28DBF; Mon, 8 Apr 2024 07:38:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="fBn2188k"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="5bBQXTwO"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="fBn2188k"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="5bBQXTwO" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22D3D25619 for ; Mon, 8 Apr 2024 07:38:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712561905; cv=none; b=EGJ/IGU7DwVksaoPwXfxcpHelqU73CKs+BTFlfC/dCGUBNGJsBCQ70TbE4yayAj7n6vm/k11g6zHgwq1knSybRjHhcnQRPkzgM+cI/8te3YctMqu7C0owUUR9QvkBem5AW7491ZBWdpMSmaSQJ2i5umTRsR8+z0iJl3C4LH7NL0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712561905; c=relaxed/simple; bh=GTL/uT0QmdkDTJG+8EUVeHgZ1nLQq/V+K6ECxsaKgJQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=o6P+NknW0R3kPQsyk5hr1KF4ZtnA7xBuflyKMsWq3m00+6SIQ8kCww7sevyTyxVX7DNQRnbMILrF5IksRJFd6bd3IhuxI0EXais15ZrUB1FY+aX5QDZFshg6pOTH27l4JrVqGP47CeN4mffQLAK9e2rgEc8gY4o31QkfDu06NWQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=fBn2188k; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=5bBQXTwO; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=fBn2188k; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=5bBQXTwO; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5D1881FDD9; Mon, 8 Apr 2024 07:38:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1712561901; 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:autocrypt:autocrypt; bh=yDXYZ+HVnjL8LE33ELw6Ev7L7ptFfBFSiqjfmx+pLTk=; b=fBn2188kDItamcKZUw6GNFQi7zDvajXvdOuQ/G+qSX7jQGwSep87thmPdX7OtGF3ASS0UD ADSf9RNosB49Wou8xYnsqGkOIAU+AGCOBbniGxg72YiFK7Wey942WDa6z1KO5H7XvJ2fFy QfpzapNUfSUyz5C5FpwwdUTxfc8mpZc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1712561901; 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:autocrypt:autocrypt; bh=yDXYZ+HVnjL8LE33ELw6Ev7L7ptFfBFSiqjfmx+pLTk=; b=5bBQXTwOVkFCX54Tjtn+j1d+9yqYRoh8cSYD2edzGBtZ9CRMi3UDCad+i1ch+61upSlXyE +IO7ImUZ+FJO7hDA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1712561901; 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:autocrypt:autocrypt; bh=yDXYZ+HVnjL8LE33ELw6Ev7L7ptFfBFSiqjfmx+pLTk=; b=fBn2188kDItamcKZUw6GNFQi7zDvajXvdOuQ/G+qSX7jQGwSep87thmPdX7OtGF3ASS0UD ADSf9RNosB49Wou8xYnsqGkOIAU+AGCOBbniGxg72YiFK7Wey942WDa6z1KO5H7XvJ2fFy QfpzapNUfSUyz5C5FpwwdUTxfc8mpZc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1712561901; 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:autocrypt:autocrypt; bh=yDXYZ+HVnjL8LE33ELw6Ev7L7ptFfBFSiqjfmx+pLTk=; b=5bBQXTwOVkFCX54Tjtn+j1d+9yqYRoh8cSYD2edzGBtZ9CRMi3UDCad+i1ch+61upSlXyE +IO7ImUZ+FJO7hDA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 422C0137D4; Mon, 8 Apr 2024 07:38:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id lTN0D+2eE2bqWQAAD6G6ig (envelope-from ); Mon, 08 Apr 2024 07:38:21 +0000 Message-ID: Date: Mon, 8 Apr 2024 09:38:20 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 10/10] mm: page_alloc: consolidate free page accounting Content-Language: en-US To: Baolin Wang , Johannes Weiner , Andrew Morton Cc: Mel Gorman , Zi Yan , "Huang, Ying" , David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20240320180429.678181-1-hannes@cmpxchg.org> <20240320180429.678181-11-hannes@cmpxchg.org> <7b3b7f2e-7109-4e72-b1cf-259cb56f3629@linux.alibaba.com> From: Vlastimil Babka Autocrypt: addr=vbabka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g++veI6tXfpco/UiKEsDswL1WAr tEAZaruo7254TyH+gydURl2wJuzo/aZ7Y7PpqaODbYv727Dvm5eX64HCyyAH0s6sOCyGF5/p eIhrOn24oBf67KtdAN3H9JoFNUVTYJc1VJU3R1JtVdgwEdr+NEciEfYl0O19VpLE/PZxP4wX PWnhf5WjdoNI1Xec+RcJ5p/pSel0jnvBX8L2cmniYnmI883NhtGZsEWj++wyKiS4NranDFlA HdDM3b4lUth1pTtABKQ1YuTvehj7EfoWD3bv9kuGZGPrAeFNiHPdOT7DaXKeHpW9homgtBxj 8aX/UkSvEGJKUEbFL9cVa5tzyialGkSiZJNkWgeHe+jEcfRT6pJZOJidSCdzvJpbdJmm+eED w9XOLH1IIWh7RURU7G1iOfEfmImFeC3cbbS73LQEFGe1urxvIH5K/7vX+FkNcr9ujwWuPE9b 1C2o4i/yZPLXIVy387EjA6GZMqvQUFuSTs/GeBcv0NjIQi8867H3uLjz+mQy63fAitsDwLmR EP+ylKVEKb0Q2A== In-Reply-To: <7b3b7f2e-7109-4e72-b1cf-259cb56f3629@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Flag: NO X-Spam-Score: -3.03 X-Spam-Level: X-Spamd-Result: default: False [-3.03 / 50.00]; BAYES_HAM(-1.74)[93.40%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; RCPT_COUNT_SEVEN(0.00)[9]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns] On 4/7/24 12:19 PM, Baolin Wang wrote: > On 2024/3/21 02:02, Johannes Weiner wrote: >> >> + account_freepages(page, zone, 1 << order, migratetype); >> + >> while (order < MAX_PAGE_ORDER) { >> - if (compaction_capture(capc, page, order, migratetype)) { >> - __mod_zone_freepage_state(zone, -(1 << order), >> - migratetype); >> + int buddy_mt = migratetype; >> + >> + if (compaction_capture(capc, page, order, migratetype)) >> return; >> - } > > IIUC, if the released page is captured by compaction, then the > statistics for free pages should be correspondingly decreased, > otherwise, there will be a slight regression for my thpcompact benchmark. > > thpcompact Percentage Faults Huge > k6.9-rc2-base base + patch10 + 2 fixes > Percentage huge-1 78.18 ( 0.00%) 71.92 ( -8.01%) > Percentage huge-3 86.70 ( 0.00%) 86.07 ( -0.73%) > Percentage huge-5 90.26 ( 0.00%) 78.02 ( -13.57%) > Percentage huge-7 92.34 ( 0.00%) 78.67 ( -14.81%) > Percentage huge-12 91.18 ( 0.00%) 81.04 ( -11.12%) > Percentage huge-18 89.00 ( 0.00%) 79.57 ( -10.60%) > Percentage huge-24 90.52 ( 0.00%) 80.07 ( -11.54%) > Percentage huge-30 94.44 ( 0.00%) 96.28 ( 1.95%) > Percentage huge-32 93.09 ( 0.00%) 99.39 ( 6.77%) > > I add below fix based on your fix 2, then the thpcompact Percentage > looks good. How do you think for the fix? Yeah another well spotted, thanks. "slight regression" is an understatement, this affects not just a "statistics" but very important counter NR_FREE_PAGES which IIUC would eventually become larger than reality, make the watermark checks false positive and result in depleted reserves etc etc. Actually wondering why we're not seeing -next failures already (or maybe I just haven't noticed). > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 8330c5c2de6b..2facf844ef84 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -805,8 +805,10 @@ static inline void __free_one_page(struct page *page, > while (order < MAX_PAGE_ORDER) { > int buddy_mt = migratetype; > > - if (compaction_capture(capc, page, order, migratetype)) > + if (compaction_capture(capc, page, order, migratetype)) { > + account_freepages(zone, -(1 << order), migratetype); > return; > + } > > buddy = find_buddy_page_pfn(page, pfn, order, &buddy_pfn); > if (!buddy) > > With my fix, the THP percentage looks better: > k6.9-rc2-base base + patch10 + 2 fixes + > my fix > Percentage huge-1 78.18 ( 0.00%) 82.83 ( 5.94%) > Percentage huge-3 86.70 ( 0.00%) 93.47 ( 7.81%) > Percentage huge-5 90.26 ( 0.00%) 94.73 ( 4.95%) > Percentage huge-7 92.34 ( 0.00%) 95.22 ( 3.12%) > Percentage huge-12 91.18 ( 0.00%) 92.40 ( 1.34%) > Percentage huge-18 89.00 ( 0.00%) 85.39 ( -4.06%) > Percentage huge-24 90.52 ( 0.00%) 94.70 ( 4.61%) > Percentage huge-30 94.44 ( 0.00%) 97.00 ( 2.71%) > Percentage huge-32 93.09 ( 0.00%) 92.87 ( -0.24%)