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.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 ED677C4727D for ; Thu, 24 Sep 2020 15:16:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 61BA420BED for ; Thu, 24 Sep 2020 15:16:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iXhYvPy0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61BA420BED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DFBDA8E0005; Thu, 24 Sep 2020 11:16:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DAB988E0001; Thu, 24 Sep 2020 11:16:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C9AE08E0005; Thu, 24 Sep 2020 11:16:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id B0CFF8E0001 for ; Thu, 24 Sep 2020 11:16:31 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7483012FF for ; Thu, 24 Sep 2020 15:16:31 +0000 (UTC) X-FDA: 77298306582.26.hand10_061771e27160 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 1AB581804B66A for ; Thu, 24 Sep 2020 15:16:31 +0000 (UTC) X-HE-Tag: hand10_061771e27160 X-Filterd-Recvd-Size: 5193 Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Thu, 24 Sep 2020 15:16:30 +0000 (UTC) Received: by mail-lf1-f66.google.com with SMTP id y2so4313386lfy.10 for ; Thu, 24 Sep 2020 08:16:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vgIr3UnaQPyUPGT1YxgZ7u38f72zk1LPY4fqYV/vg8k=; b=iXhYvPy0LzzINWscEsEuBJcHyNnMX2Q16bBmhHorBDz03Q5SDV4E7eNcUShLpEy/HA vhLmMSvEojyifVv1TrPHcrueBEvatmn6Ije7kFLzZ2YcCMyu+1pUUJ/t8dXXPXCbN1WJ cDp8Ml8B1Qh0vdg6VB+NaATaAe9MM9LLwW9ttO5mdULIjjk8bxBjVTVX8TSNqp8+3eRq CTPJAS6yi1fwkiUNXWsG61mLH6LuR6lf2xBjZA/hxAfhPooqyF/19VVxZnypaWIyj+VL iVuctOkCFTShInFW8LM2JetY6GJ+kmX+bj/iA39jMNqZo6JHhaRchtpiwGgZ/Gl0eT3+ eI0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vgIr3UnaQPyUPGT1YxgZ7u38f72zk1LPY4fqYV/vg8k=; b=DD7KKT8DWfDLXnpnrz6TjXPKYFgreMid7aUnReZkrIq/GDe6Yw2A2ApXOYYNMekJ7Y pT742cMw7KDlKqc2wU1gfCzqdcK6YgyBcMy9a4qJIB1Cl0qw6RFJrZDNGpuq0ATiDHQ3 yeqxUVlOazp3eMF0JbE1DtzeqXZ6vsTa+5JRzFdAhNqUrzlcS+m8dleSfDsWCltYVbFo +PJ05zKjJ8RGj3qX8xLhHTctEdND9ePbYBLOK9G9HE2Uhv6iG2Ic6QWcv27nuYaQ2ojy obemu2C8ANHWL7/Z8wWgIUzJe+w+bQ+f3ClcgzlvvAcyUpClMKA4DmpbJX3/LGu2jsSt X/0A== X-Gm-Message-State: AOAM532oxCZdLe/wGZbl0quq++bCYTMNIviyopnkkgyC4KXzGcmIqxb7 L+6WRlUYZDf5xwEiFq9rSEk= X-Google-Smtp-Source: ABdhPJzK2d/M+AZ9drrmmGdPQ2ZzuwPUEP3T7OwuWubTbWcL2qi9PC3R4p1P1pZ8awnBiEKz6kM71A== X-Received: by 2002:a19:430c:: with SMTP id q12mr470114lfa.68.1600960588909; Thu, 24 Sep 2020 08:16:28 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id 193sm2311575lfb.212.2020.09.24.08.16.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2020 08:16:27 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 24 Sep 2020 17:16:25 +0200 To: Peter Zijlstra Cc: Uladzislau Rezki , Mel Gorman , "Paul E. McKenney" , Michal Hocko , LKML , RCU , linux-mm@kvack.org, Andrew Morton , Vlastimil Babka , Thomas Gleixner , "Theodore Y . Ts'o" , Joel Fernandes , Sebastian Andrzej Siewior , Oleksiy Avramchenko , Mel Gorman Subject: Re: [RFC-PATCH 2/4] mm: Add __rcu_alloc_page_lockless() func. Message-ID: <20200924151625.GA19013@pc636> References: <20200921154558.GD29330@paulmck-ThinkPad-P72> <20200921160318.GO12990@dhcp22.suse.cz> <20200921194819.GA24236@pc636> <20200922075002.GU12990@dhcp22.suse.cz> <20200922131257.GA29241@pc636> <20200923103706.GJ3179@techsingularity.net> <20200923154105.GO29330@paulmck-ThinkPad-P72> <20200923232251.GK3179@techsingularity.net> <20200924081614.GA14819@pc636> <20200924111632.GD2628@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200924111632.GD2628@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Thu, Sep 24, 2020 at 01:16:32PM +0200, Peter Zijlstra wrote: > On Thu, Sep 24, 2020 at 10:16:14AM +0200, Uladzislau Rezki wrote: > > Other option is if we had unconditionally enabled PREEMPT_COUNT config. > > It would be easy to identify a context type and invoke a page allocator > > if a context is preemtale. But as of now preemptable() is "half" working. > > Thomas uploaded patches to make it unconditional. But it can be blocked. > > While I in principle support Thomas' patch, I think this is an abuse and > still complete wrong. > Good that you support it :) > > Not all preemptible() context can deal with GFP_KERNEL (GFP_NOFS > existing should be a clue). !preemptible context cannot unconditionally > deal with GFP_NOWAIT, consider using it while holding zone->lock. > Not sure if i fully follow you here. What i tried to express, if we had preemtable() fully working, including !PREEMPT, we can at least detect the following: if (!preemptable()) by pass using any ATOMIC/NOWAIT flags because they do not work; as an example you mentioned z->lock that is sleepable. > > The preemption context does not say antying much useful about the > allocation context. > I am talking about taking a decision. -- Vlad Rezki