Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp403130pxk; Thu, 24 Sep 2020 08:21:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvvLXMoCImLpvFzC1qQ6jeE3M8MreI2/R5B0sB/w9+FzSiMEFeDuX7chqWQwqicvgXhLbm X-Received: by 2002:aa7:cd90:: with SMTP id x16mr426070edv.302.1600960870368; Thu, 24 Sep 2020 08:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600960870; cv=none; d=google.com; s=arc-20160816; b=fEYE6USPqYKTYGbtwgDcGJ+f8uhIvs6cE3JC9BacMjpCich1Lk4Lv/nMl/mtISAhY3 4pZqa0V8LqNsPjLIgZZ+gEq9F6Nu4gp+WFjyFa1/bYbuyjZ7B6DMKTx9Jq3JHPS7Or6C tJAQ6T96a8iBGs7yasfr00IoEQzCN+Qj7gPMLnnqT+gH0GuhRJYzaUw9796S65xy8dtP DeYRZ3rAaWyhz5o7Oe3OtXtksPggAp99asg/VngCQKJ0JuS2SutjsJS3xLkephYo2fuI 4+GY9GqArJAsHPF6yNo/mvzLhisYxoi6cv96UBdPOMkOOAMPco4Wmfvr5/VGbF4+kjit n4Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=vgIr3UnaQPyUPGT1YxgZ7u38f72zk1LPY4fqYV/vg8k=; b=DudcYp4cL4Dyk/GZPhKaj6ftp/z3shgoGrbWulglWT3rYpOK58ytHQEJbymtVsJ1AX TpynIRQGQ3teIrmZLYeO5cACe/ZURlNaY1jv4FuGHZCOxNE+LNCniSpDxDXuZyq+KK4W eB73YVoyEIUCLVHAOHzFw+TjUM0kP9kY9klFPbPqG34r//VJG3yr9LaldZQd5NLlrgUx khXyLOZOoQIS17ZbkGl09eJOPZVSg7ESR+RLrXFGJOSK2js/PkeiICzWwqOEi0u/Ef0g Bb9ADmp2hyG6eCPRP9/X06Q79uc5IzOp1xZYtilHlxxeBffWGiA1ae34UruoeZ1RzaGy XM6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iXhYvPy0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by20si3103173ejc.416.2020.09.24.08.20.47; Thu, 24 Sep 2020 08:21:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iXhYvPy0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728419AbgIXPQd (ORCPT + 99 others); Thu, 24 Sep 2020 11:16:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728273AbgIXPQb (ORCPT ); Thu, 24 Sep 2020 11:16:31 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DF13C0613CE; Thu, 24 Sep 2020 08:16:30 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id q8so4353872lfb.6; 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=gxBglCQ2YwoZmnEjbG2xxR17W79yE/SLiX7xCPCngJ+r3LRbQEoYQjkO1wbSFl636L l0fN3LHpO0MvnIB0CKwIYoLxb/k6tZYmPcwxn58g+2MDgeDbCTetuHv+EkbpEDhwyXFv dl0UoChW5vITFOSyArUMJL03rZ7lwgEW6+DxwgsQH1cTbFp3YwPrRqAhl4K3spw++xfd bmflYz/if1Bw2r+gt32C9MZwDEJkw3KIIF9iZFBeN0rwBiTPEu3rXLFTgjOW3FzT1Djx faIGNwxrmRR1/W1GnCrFxxarOBVZmXd7rB4BUfeVjdFNHHlI7Y3KNjDatdOPpyG4RRpZ AzCg== X-Gm-Message-State: AOAM531GQ86lO2Tc4HZJCb0SG62IC2UeVDYo1RTgosKI6aJiWBIq5ql1 D6PYU0rR5xqaibF5OpfP7gs= 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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