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 199E2C32772 for ; Tue, 23 Aug 2022 12:18:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 60F436B0073; Tue, 23 Aug 2022 08:18:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5BFBA6B0074; Tue, 23 Aug 2022 08:18:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 487A38D0001; Tue, 23 Aug 2022 08:18:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 38AEB6B0073 for ; Tue, 23 Aug 2022 08:18:30 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0AF8FC14EF for ; Tue, 23 Aug 2022 12:18:30 +0000 (UTC) X-FDA: 79830760380.24.42C338C Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf12.hostedemail.com (Postfix) with ESMTP id 88D1E40014 for ; Tue, 23 Aug 2022 12:18:29 +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 360E01FA73; Tue, 23 Aug 2022 12:18:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1661257108; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Fa+Q7bBdjZHhzElGU1lODknSBZk1KrpP9GddSZFdeB4=; b=hKYiRGg2EVRDxaIGACDpvdowNUMd73jTzWstUwhoNlhi9RKeN8XAmv4o88dHD9yMkwNQmR uGpavfOfd8ImvL0gCS+4lQ1qSGi9lY7wNnATGrq0DFBTeBARU5+v6481Mw3WJ1APeCs9r6 v6NFENVLJGH1pqlW9VmCslDe28IUzSE= 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 17CC013AB7; Tue, 23 Aug 2022 12:18:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bWvABZTFBGPXQgAAMHmgww (envelope-from ); Tue, 23 Aug 2022 12:18:28 +0000 Date: Tue, 23 Aug 2022 14:18:27 +0200 From: Michal Hocko To: Mel Gorman Cc: David Hildenbrand , Patrick Daly , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Juergen Gross Subject: Re: Race condition in build_all_zonelists() when offlining movable zone Message-ID: References: <20220817034250.GB2473@hu-pdaly-lv.qualcomm.com> <20220817104028.uin7cmkb4qlpgfbi@suse.de> <11f91089-1958-c7eb-126f-af32130d9f8a@redhat.com> <20220823083349.5c2aolc6xgfhp3k7@suse.de> <20220823094950.ocjyur2h3mqnqbeg@suse.de> <0fc01e47-51f3-baf7-2d46-72291422f695@redhat.com> <20220823110946.o3eawk3kghaykcim@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220823110946.o3eawk3kghaykcim@suse.de> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661257109; a=rsa-sha256; cv=none; b=G97uMDKWLY/e5U5txeEwTcGDRblw9t+8KxGtvlKwxEeOp6m3Mz9uQPceTK5s+4OyglrKqp X/95VN1kcsACzAk0O9u23W9yBJWvhateFauRYU+Y4GmIXCyvy9oKrMR/IB4tQb6tdBgoAD VBE6jK7lS0YMce1DU4uxg7OatQ9xAaY= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=hKYiRGg2; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf12.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661257109; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Fa+Q7bBdjZHhzElGU1lODknSBZk1KrpP9GddSZFdeB4=; b=KayjXYbzv9bxTGloIqsPBO0ITRTxfoHZQYbesxN+bnAX+pq0w9WQFOmnKn0UNMXgiNPurs L7ZSwaHGT4BnF+hAALfDYam9XDYunjTSN0j7TAXK42C1HTXhYsQGUz5gkMLuMk0LdAKn9c VYgK6Vp60IomkQ0PlPTtwli+mofRwlQ= X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 88D1E40014 X-Rspam-User: Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=hKYiRGg2; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf12.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Stat-Signature: yb8ymkddo35gqp1wkpryb7drywp6d88w X-HE-Tag: 1661257109-329479 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 Tue 23-08-22 12:09:46, Mel Gorman wrote: > On Tue, Aug 23, 2022 at 12:34:09PM +0200, David Hildenbrand wrote: > > > @@ -6553,7 +6576,7 @@ static void __build_all_zonelists(void *data) > > > #endif > > > } > > > > > > - spin_unlock(&lock); > > > + write_sequnlock(&zonelist_update_seq); > > > } > > > > > > static noinline void __init > > > > > > > LGTM. The "retry_cpuset" label might deserve a better name now. > > > > Good point ... "restart"? > > > Would > > > > Fixes: 6aa303defb74 ("mm, vmscan: only allocate and reclaim from zones > > with pages managed by the buddy allocator") > > > > be correct? > > > > Not specifically because the bug is due to a zone being completely removed > resulting in a rebuild. This race probably existed ever since memory > hotremove could theoritically remove a complete zone. A Cc: Stable would > be appropriate as it'll apply with fuzz back to at least 5.4.210 but beyond > that, it should be driven by a specific bug report showing that hot-remove > of a full zone was possible and triggered the race. I do not think so. 6aa303defb74 has changed the zonelist building and changed the check from pfn range (populated) to managed (with a memory). -- Michal Hocko SUSE Labs