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 X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CD7FC47082 for ; Tue, 8 Jun 2021 10:42:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A8B0C61263 for ; Tue, 8 Jun 2021 10:42:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8B0C61263 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EA5B06B006C; Tue, 8 Jun 2021 06:42:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E558B6B006E; Tue, 8 Jun 2021 06:42:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCF376B0070; Tue, 8 Jun 2021 06:42:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0148.hostedemail.com [216.40.44.148]) by kanga.kvack.org (Postfix) with ESMTP id 9DA0F6B006C for ; Tue, 8 Jun 2021 06:42:31 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 442E812E8 for ; Tue, 8 Jun 2021 10:42:31 +0000 (UTC) X-FDA: 78230217702.27.3852669 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf01.hostedemail.com (Postfix) with ESMTP id 7592C5001700 for ; Tue, 8 Jun 2021 10:42:27 +0000 (UTC) Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A50581FD33; Tue, 8 Jun 2021 10:42:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623148949; 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=JRj2FQZ7QVfqBjtUOD4OpmT+xgtTDURi7+2WAKgq0eU=; b=E3ZlrR8iQDx2JYcCOrXRWa75EIdWTDnDbeBIHUaFAHt52VnLDc1z8FYgqUsIXjaHR7pLWR MYUYUXgaBEKK567SYoQdfhdylctmO0nO0yQgJhZ1/JfU7/Wd34d9t6hDSIY5r5dgYG9NW4 T9ivPfvLQPNRUnSaFlNNS817rLI/mFY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623148949; 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=JRj2FQZ7QVfqBjtUOD4OpmT+xgtTDURi7+2WAKgq0eU=; b=/iik28C4PXYiFZJpgFdM0e+0XDe3EVfPC4qsUXrgJcTzvN5Lh27kO+aMgfk4NsbLw/8q1y KJDmHvPSDgEqx8DA== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 20101118DD; Tue, 8 Jun 2021 10:42:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623148949; 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=JRj2FQZ7QVfqBjtUOD4OpmT+xgtTDURi7+2WAKgq0eU=; b=E3ZlrR8iQDx2JYcCOrXRWa75EIdWTDnDbeBIHUaFAHt52VnLDc1z8FYgqUsIXjaHR7pLWR MYUYUXgaBEKK567SYoQdfhdylctmO0nO0yQgJhZ1/JfU7/Wd34d9t6hDSIY5r5dgYG9NW4 T9ivPfvLQPNRUnSaFlNNS817rLI/mFY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623148949; 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=JRj2FQZ7QVfqBjtUOD4OpmT+xgtTDURi7+2WAKgq0eU=; b=/iik28C4PXYiFZJpgFdM0e+0XDe3EVfPC4qsUXrgJcTzvN5Lh27kO+aMgfk4NsbLw/8q1y KJDmHvPSDgEqx8DA== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id KEKGBJVJv2BiCQAALh3uQQ (envelope-from ); Tue, 08 Jun 2021 10:42:29 +0000 Date: Tue, 8 Jun 2021 12:42:27 +0200 From: Oscar Salvador To: David Hildenbrand Cc: Michal Hocko , Andrew Morton , Dave Hansen , Anshuman Khandual , Vlastimil Babka , Pavel Tatashin , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] mm,page_alloc: Use {get,put}_online_mems() to get stable zone's values Message-ID: <20210608104227.GB22894@linux> References: <20210602091457.17772-1-osalvador@suse.de> <20210602091457.17772-2-osalvador@suse.de> <39473305-6e91-262d-bcc2-76b745a5b14a@redhat.com> <20210604074140.GA25063@linux> <20210607075147.GA10554@linux> <85984701-55ae-dfa5-2a8d-f637051b612d@redhat.com> <20210607102318.GA12683@linux> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210607102318.GA12683@linux> User-Agent: Mutt/1.10.1 (2018-07-13) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=E3ZlrR8i; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/iik28C4"; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=E3ZlrR8i; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/iik28C4"; dmarc=none; spf=pass (imf01.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=osalvador@suse.de X-Rspamd-Server: rspam02 X-Stat-Signature: z6w953qh4j5em5gkb1ijbq5osiup4wj6 X-Rspamd-Queue-Id: 7592C5001700 X-HE-Tag: 1623148947-85592 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 Mon, Jun 07, 2021 at 12:23:25PM +0200, Oscar Salvador wrote: > I can see arguments for both riping it out and doing it right (but none for > the way it is right now). > For riping it out, one could say that those races might not be fatal, > as usually the pfn you're working with (the one you want to check falls > within a certain range) you know is valid, so the worst can happen is > you get false positives/negatives and that might or might not be detected > further down. How bad are false positive/negatives I guess it depends on the > situation, but we already do that right now. > The zone_spans_pfn() from page_outside_zone_boundaries() is the only one using > locking right now, so well, if we survided this long without locks in other places > using zone_spans_pfn() makes one wonder if it is that bad. Givne that a) all current users of bad_range() are coming from VM_BUG_ON* callers b) we only care when removing memory as the page would not lie in the zone anymore. But for that to happen the whole offline_pages() operation needs to succeed. bad_range() is called from rmqueue(), __free_one_page() and expand(). If offline_pages() succeeds for the range our page lies on, we would not be doing those operations on that page anyway? So, I cannot find any strong reason to keep the seqlock (maybe in the future we need to re-add it because some usecase). Any objection on removing it? -- Oscar Salvador SUSE L3