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 60B8AC433FE for ; Fri, 18 Nov 2022 13:24:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 97EF76B0071; Fri, 18 Nov 2022 08:24:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 92ECD8E0001; Fri, 18 Nov 2022 08:24:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 81D8A6B0073; Fri, 18 Nov 2022 08:24:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 721D26B0071 for ; Fri, 18 Nov 2022 08:24:48 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 3484C16131D for ; Fri, 18 Nov 2022 13:24:48 +0000 (UTC) X-FDA: 80146633056.14.E468AAA Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf24.hostedemail.com (Postfix) with ESMTP id 86A94180013 for ; Fri, 18 Nov 2022 13:24:46 +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-out2.suse.de (Postfix) with ESMTPS id 185471FA51; Fri, 18 Nov 2022 13:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668777885; 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=KjSzJOUlS6BPTCP6rxsM/mMEKiqvCtEfd6HOKLUviYI=; b=C9muodQBTkufJz+UqsoeXUlSNBMEGazEu5rJTHV/2KYuXxZeBsQleafQKcx0/q7Hj0RQ7l xQnhiBqYUXEuRLukzAUvc3NOWu8/FLqr5vzpuyLecXFpD/LQ+jrzxcbgbG9rG6Aesp8qU9 g42T6ppUyUUNr9ySoe0NpNTzdpe5wHg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668777885; 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=KjSzJOUlS6BPTCP6rxsM/mMEKiqvCtEfd6HOKLUviYI=; b=v4bNxqLzI2sj+ptZdrXbng62t8NVbedr7UQjHOV9KojsLHMvRWV2tF3hsMEXMLzkTV0mOv w1msrSNvQgk/JnAQ== 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 E5CF413A66; Fri, 18 Nov 2022 13:24:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iSdfN5yHd2O6JgAAMHmgww (envelope-from ); Fri, 18 Nov 2022 13:24:44 +0000 Message-ID: Date: Fri, 18 Nov 2022 14:24:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 1/2] mm/page_alloc: Always remove pages from temporary list Content-Language: en-US To: Mel Gorman , Andrew Morton Cc: Hugh Dickins , Yu Zhao , Marcelo Tosatti , Michal Hocko , Marek Szyprowski , LKML , Linux-MM References: <20221118101714.19590-1-mgorman@techsingularity.net> <20221118101714.19590-2-mgorman@techsingularity.net> From: Vlastimil Babka In-Reply-To: <20221118101714.19590-2-mgorman@techsingularity.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668777886; a=rsa-sha256; cv=none; b=C+P9ESrGo3NRWQDFpdqf0rI4j+jD3W2elucWsfg6q898NPyk2lx98P4YqOSbiX/Vt9IUsw rT3824QSrCGr0yoh7dj6T5WkxJRlKB+13/D0zkrwk+bwMavp148Y+kPb2iFHRGBDrUPiCK KueAYC6YVH4ZaHh7bMZfLN/5AP/jbFs= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=C9muodQB; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=v4bNxqLz; dmarc=none; spf=pass (imf24.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668777886; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KjSzJOUlS6BPTCP6rxsM/mMEKiqvCtEfd6HOKLUviYI=; b=3JkoMOc7/wnkSohYQjTzDYEDLUehJGzAsvxNFYHJSNwqx0axq3dzWlq4axX66AdpxGo7RU JSsN6jEMCANBOMmG5XIKrUP32ObPkVU8JZEIEyK6RZxyLm1V2S6+XQFt2RCUVTLxbcJxxq lyf3RLDPVs03F1zfOaFIm9UK/12lBf0= Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=C9muodQB; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=v4bNxqLz; dmarc=none; spf=pass (imf24.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspam-User: X-Stat-Signature: 8jc58id7b4dro7b84a5x9okxftmfepwk X-Rspamd-Queue-Id: 86A94180013 X-Rspamd-Server: rspam11 X-HE-Tag: 1668777886-108302 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 11/18/22 11:17, Mel Gorman wrote: > free_unref_page_list() has neglected to remove pages properly from the list > of pages to free since forever. It works by coincidence because list_add > happened to do the right thing adding the pages to just the PCP lists. > However, a later patch added pages to either the PCP list or the zone list > but only properly deleted the page from the list in one path leading to > list corruption and a subsequent failure. As a preparation patch, always > delete the pages from one list properly before adding to another. On its > own, this fixes nothing although it adds a fractional amount of overhead > but is critical to the next patch. > > Reported-by: Hugh Dickins > Signed-off-by: Mel Gorman Reviewed-by: Vlastimil Babka > --- > mm/page_alloc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 218b28ee49ed..1ec54173b8d4 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -3546,6 +3546,8 @@ void free_unref_page_list(struct list_head *list) > list_for_each_entry_safe(page, next, list, lru) { > struct zone *zone = page_zone(page); > > + list_del(&page->lru); > + > /* Different zone, different pcp lock. */ > if (zone != locked_zone) { > if (pcp)