Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1176605lqe; Mon, 8 Apr 2024 00:24:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUkqga2CpINQURLnuWJhooPVk73YxR7y2p+u4iakKZgVDSQlx5XIWwkytaEJ1TdCLQdFKZ3j8QoOxmcTnGsPX6ynS21e5So0kBDKrNoSw== X-Google-Smtp-Source: AGHT+IGBrqJRnyVbas6NHJbZpdfC7gQMKTWRmoMt2uAeiC0Xk8uXaWH/IsB7xtO9idRL3WZEfp2g X-Received: by 2002:a05:6a00:139c:b0:6ea:e2d8:471 with SMTP id t28-20020a056a00139c00b006eae2d80471mr8352976pfg.28.1712561094858; Mon, 08 Apr 2024 00:24:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712561094; cv=pass; d=google.com; s=arc-20160816; b=IhnJ0G/ROPBXSlkzXHreYcdWZb1oxXY3g5NZrslVFToeJXzP0R+rOyO0IBZ4ZHK5yf UlA4HwIM9C6ANbGutcQlcRweuC8cfpGaMt1agyj3/zoj3pWHT87lOt7SWXnf7ve0x8gR xzvR4ppnxSOvGPFv82PwAO+RwuF28JsuzDjIaQ64Bx4bv2w5aum8jHIAywE8iHDO+hc4 7qypiZiYOnrgP6n0yfd9j+4xYv2sctAZNY49vX8cy+B+GHh6erBFvAGY71N6yNutYTE5 3We/xu4ettQL78SxfOkbiXX5DOklVWEgxnPW58zBPpQ0DiVl9WhOMngzBm1FDCEUJVmm S/4w== 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 :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=jw0Cf55nW5Tg0F05ULD5iX4tyTlnhA4K0O/FVOVhRZ0=; fh=VdyoPKWERq4WMghiSthMz1eY7Z1O9GWBVcwyEVCLwL0=; b=WfRhSCIBO7Lo1pcMEcWniXwpSvTJn75XARzyDdhIUyOcHkJXkynrROXm15MUHd2wJJ a9n3NWHfbpM8qmhGzGQU6FZgoTKcOEqBrYmyTPaGBm//5dY7nojJ1pyeRwaKnFbMiv27 cu/HFcO00RTBph8vE81+/l2ouaAdu0G02n5oVi9kh9RwrnPQ3l2s1O5dOUy/HUI+JzhL RCAptm1fguu4mihfSKQQcukGJtOuQW3liMrUjvp+kpX4dPfTcMQdRqx7+Rzr/OlOVY2R jkHNMbRfjmK7RarSJ3b2z+2yowIkX/AfrU3yGdGB6LVFZbTlEb4wgksayB/os5FUS+rp SgEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ew5o9A6S; dkim=neutral (no key) header.i=@suse.cz header.b=0HbvGBvO; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ew5o9A6S; dkim=neutral (no key) header.i=@suse.cz; 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-134897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134897-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 p20-20020a62ab14000000b006ea706a024fsi5652963pff.358.2024.04.08.00.24.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 00:24:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134897-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=ew5o9A6S; dkim=neutral (no key) header.i=@suse.cz header.b=0HbvGBvO; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ew5o9A6S; dkim=neutral (no key) header.i=@suse.cz; 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-134897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134897-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 AA126283C32 for ; Mon, 8 Apr 2024 07:24:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 146042C853; Mon, 8 Apr 2024 07:24:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="ew5o9A6S"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="0HbvGBvO"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="ew5o9A6S"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="0HbvGBvO" 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 D0CDF2C68A for ; Mon, 8 Apr 2024 07:24:37 +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=1712561080; cv=none; b=NgQLQkvy55nwkz0Mlgtskr/dVvhANiwcHiFx8BB9frBMGtyr7UNOCLRO9AgqGpcOl6ekpXo0x5OzBQ7A6OGUUjwM8YOP4rjk4LfZdJESTUdxhAnKIBohFf1BCu793lkuwHaHXDRCz3LeYYARixxbcwxsvZb5O4z9IkDkHhQBbIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712561080; c=relaxed/simple; bh=Ec2duNUUMiWhZuP3Opa8MkMBI4JdGYvmLcNQyn6Adhw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ViCxfT5Gadd79POTS2ql5HbUanRTZMc0V1a09zu4mgTFF5GuC5HhOvtrokjNpmPlno30gCuRKLwf4/FpIrl7YwAeWbWZk6BWJ4uSxJMNcdCVr2JFk69daHfaS6yEsnM7IPmfNZAAfOLh3yfIHMwnFvhbGQZWf1aQ0Tuxn3KOSJ8= 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=ew5o9A6S; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=0HbvGBvO; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=ew5o9A6S; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=0HbvGBvO; 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 C8472201D2; Mon, 8 Apr 2024 07:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1712561075; 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=jw0Cf55nW5Tg0F05ULD5iX4tyTlnhA4K0O/FVOVhRZ0=; b=ew5o9A6Sf0+Q01zjsFb6MefkWigGRKSaCySsP4kO53ODpCgw2aYQhpggz8AOvSnl3UB1dn TO29fcFYKSxO5Z+SzMK9kUApmwOe1nWH8ReuDuVjT8UlvEPPQqezxHu3azGC/bOKK66BFm gZkXposCnMZU0VR7SpoUMmDqfJi2Mso= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1712561075; 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=jw0Cf55nW5Tg0F05ULD5iX4tyTlnhA4K0O/FVOVhRZ0=; b=0HbvGBvOfCehCHiRt0nZBiVCzBxqoTU8kJGviQHfASVGkflC9wmluxq3SOoq9IpKACMg7Z 6HmetcEkxDSTDdAw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1712561075; 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=jw0Cf55nW5Tg0F05ULD5iX4tyTlnhA4K0O/FVOVhRZ0=; b=ew5o9A6Sf0+Q01zjsFb6MefkWigGRKSaCySsP4kO53ODpCgw2aYQhpggz8AOvSnl3UB1dn TO29fcFYKSxO5Z+SzMK9kUApmwOe1nWH8ReuDuVjT8UlvEPPQqezxHu3azGC/bOKK66BFm gZkXposCnMZU0VR7SpoUMmDqfJi2Mso= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1712561075; 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=jw0Cf55nW5Tg0F05ULD5iX4tyTlnhA4K0O/FVOVhRZ0=; b=0HbvGBvOfCehCHiRt0nZBiVCzBxqoTU8kJGviQHfASVGkflC9wmluxq3SOoq9IpKACMg7Z 6HmetcEkxDSTDdAw== 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 B6E7A13675; Mon, 8 Apr 2024 07:24:35 +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 R1pZLLObE2agVgAAD6G6ig (envelope-from ); Mon, 08 Apr 2024 07:24:35 +0000 Message-ID: <11406370-b90f-4f47-a2bb-6a03e2ac772a@suse.cz> Date: Mon, 8 Apr 2024 09:24:35 +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 06/10] mm: page_alloc: fix freelist movement during block conversion To: Johannes Weiner , Baolin Wang Cc: Andrew Morton , 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-7-hannes@cmpxchg.org> <20240405165632.GA870124@cmpxchg.org> Content-Language: en-US From: Vlastimil Babka Aut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eobXBDDE31t5SBg++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: <20240405165632.GA870124@cmpxchg.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Flag: NO X-Spam-Score: -2.09 X-Spam-Level: X-Spamd-Result: default: False [-2.09 / 50.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; BAYES_HAM(-0.80)[84.70%]; 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/5/24 6:56 PM, Johannes Weiner wrote: > Hi Baolin, > Ouch, sorry about that! I changed that specific part around later > during development and didn't retest with CMA. I'll be sure to > re-enable it again in my config. > >> After making the following modifications, the regression is gone. >> >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >> index ce67dc6777fa..a7cfe65e45c1 100644 >> --- a/mm/page_alloc.c >> +++ b/mm/page_alloc.c >> @@ -2139,7 +2139,8 @@ __rmqueue(struct zone *zone, unsigned int order, >> int migratetype, >> if (unlikely(!page)) { >> if (alloc_flags & ALLOC_CMA) >> page = __rmqueue_cma_fallback(zone, order); >> - else >> + >> + if (!page) >> page = __rmqueue_fallback(zone, order, migratetype, >> alloc_flags); >> } >> >> But I am not sure your original change is intentional? IIUC, we still >> need try fallbacking even though CMA allocation is failed, please >> correct me if I misunderstand your code. Thanks. > > No, this was accidental. I missed that CMA dependency when changing > things around for the new return type of __rmqueue_fallback(). Your > fix is good: just because the request qualifies for CMA doesn't mean > it will succeed from that region. We need the fallback for those. > > Andrew, could you please pick up Baolin's change for this patch? > > [baolin.wang@linux.alibaba.com: fix allocation failures with CONFIG_CMA] > > Thanks for debugging this and the fix, Baolin. Good fix indeed, didn't spot the issue during review. Thanks!