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=-5.4 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 16DCEC46466 for ; Mon, 5 Oct 2020 16:56:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9B66B207F7 for ; Mon, 5 Oct 2020 16:56:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="UXYAOqmy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B66B207F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DF6E56B00A1; Mon, 5 Oct 2020 12:56:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DA5636B00A2; Mon, 5 Oct 2020 12:56:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBBAC6B00A3; Mon, 5 Oct 2020 12:56:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 9CAEC6B00A1 for ; Mon, 5 Oct 2020 12:56:55 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 266AF180AD807 for ; Mon, 5 Oct 2020 16:56:55 +0000 (UTC) X-FDA: 77338476390.19.hen18_5b0dab3271bf Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 009DB1AD1B7 for ; Mon, 5 Oct 2020 16:56:54 +0000 (UTC) X-HE-Tag: hen18_5b0dab3271bf X-Filterd-Recvd-Size: 3020 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Mon, 5 Oct 2020 16:56:54 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1601917013; h=from:from:reply-to:subject:subject: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=LJvYds/wD1O5GvGho9OM+saELouoiP6YUhrMprYkKVw=; b=UXYAOqmyjGsMiq9yy7cAACto0hftLLoFY+YqsBV37MVrqnb+5noUWcCoMBajFhSoK2cNbX R6a+FEmKLEUgOUmG4DU82kG5FC/aiFo98tzbiiitvC58O3mf+n2rbPqTy0c/kz0TlfCVXP iJBUekiUeqxyvlcg7loqf8uLYvdq5LE= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 406A9AB54; Mon, 5 Oct 2020 16:56:53 +0000 (UTC) Date: Mon, 5 Oct 2020 18:56:51 +0200 From: Michal Hocko To: Vlastimil Babka Cc: David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Pavel Tatashin , Oscar Salvador , Joonsoo Kim Subject: Re: [PATCH 9/9] mm, page_alloc: optionally disable pcplists during page isolation Message-ID: <20201005165651.GG4555@dhcp22.suse.cz> References: <20200922143712.12048-1-vbabka@suse.cz> <20200922143712.12048-10-vbabka@suse.cz> <10cdae53-c64b-e371-1b83-01d1af7a131e@redhat.com> <2ce92f9a-eaa2-45b2-207c-46a79d6a2bde@suse.cz> <20201005140531.GE4555@dhcp22.suse.cz> <5ea97462-7924-e106-c486-2a0164ea27fb@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ea97462-7924-e106-c486-2a0164ea27fb@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000027, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon 05-10-20 16:22:46, Vlastimil Babka wrote: > On 10/5/20 4:05 PM, Michal Hocko wrote: > > On Fri 25-09-20 13:10:05, Vlastimil Babka wrote: > >> On 9/25/20 12:54 PM, David Hildenbrand wrote: > >> > >> Hmm that temporary write lock would still block new callers until previous > >> finish with the downgraded-to-read lock. > >> > >> But I guess something like this would work: > >> > >> retry: > >> if (atomic_read(...) == 0) { > >> // zone_update... + drain > >> atomic_inc(...); > >> else if (atomic_inc_return == 1) > >> // atomic_cmpxchg from 0 to 1; if that fails, goto retry > >> > >> Tricky, but races could only read to unnecessary duplicated updates + flushing > >> but nothing worse? > >> > >> Or add another spinlock to cover this part instead of the temp write lock... > > > > Do you plan to post a new version or should I review this one? > > I will, hopefully this week, but you could comment on other details and > overall approach meanwhile? I don't think it will change significantly. OK. I will have a look tomorrow. -- Michal Hocko SUSE Labs