Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1285763ybh; Thu, 16 Jul 2020 08:06:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfGgSPylwkjWfubE52yCKSa5oC/qliKuItfgj7WRwFIaOTQwcKHivmNQfwHXn65o1dAapA X-Received: by 2002:a17:906:8588:: with SMTP id v8mr4283598ejx.211.1594911961431; Thu, 16 Jul 2020 08:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594911961; cv=none; d=google.com; s=arc-20160816; b=ZUzgGh7s/xFsEdRRPGpFMxw+FJ8WIDHR1OI8I2p0q8vY+5AmBMSQYa2TADAtmwjZrO YWUcywjgfpH+LloZhckc8gCrF7xJRq7bVyx6eDCqT/TLjkDBohZ9/L+JOH3m1Kxr0fCA by/wtoLYQ8U/+slAHZMU3MOe9QaKLkTlzYTjylhvrBvQLcgQx0ySZJArZcn6GCVaELLs U8QkzMuNKnn1p6wJu7PE9y0A15MYiO9dzMQXyocb1fZbUK6kV9DtgnsTNscTf/ocnD0b qQ/n7uBnK4P6jdbgPR+TPzNhRaZGbzrfAQ9hPSaTCDkS8MO2MKz7Qd0rafuj2cuzBJQt NbEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from :dkim-signature:dkim-signature:date; bh=4PnkyZYWZOMwLjT2XEuyBaxyGODDUJAPPfVAnXgJWzM=; b=G4k/jOJGvwwIlnTVUGQzhoypq4eILufbfOIhIAIwrEZMJQmzCft+5ccrMyBA3VrxWL wiNUy0z8quUqEHKk/Qlv0V/vkiwYngMIVAlFDyrqn5MsOMeeUQEzUr7NLB1+Iev6NU1I ulc6K1OFilngilKXGBf9PQ+cLAHX287HuWAWnNnVmW93gRLo5pZ4dsKBNqgLuzEgsbiW EXmLHVxAEU/IBNeVzcgbx6QmrY3j6FZqi+itprepY+oZtRYHR2Ch1Caaxd08J/pK8dG8 H1/2aTeV3T0qe75frNJsfPYbQs57hhcl9sLgf3U+x8k7EiQRWxDGzyengjhcVsVS576P 78LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=GQ2HYs4G; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gg21si3035364ejb.694.2020.07.16.08.05.35; Thu, 16 Jul 2020 08:06:01 -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=@linutronix.de header.s=2020 header.b=GQ2HYs4G; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728690AbgGPPET (ORCPT + 99 others); Thu, 16 Jul 2020 11:04:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728207AbgGPPES (ORCPT ); Thu, 16 Jul 2020 11:04:18 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3EBDC061755; Thu, 16 Jul 2020 08:04:17 -0700 (PDT) Date: Thu, 16 Jul 2020 17:04:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1594911856; 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=4PnkyZYWZOMwLjT2XEuyBaxyGODDUJAPPfVAnXgJWzM=; b=GQ2HYs4GXHXYKdgmS+JrKF0AdMhLCpbdhXTzdlWuN8uhLEP5TnDaw45/Os8glke2PRgdBd 8QDd8BbUqKs3lHZ6CupHCesEAKEIEWamnNZVfLtQs3gwWnwR7BORXnSVzcFRCIT+E4LuNd ZCJJNXJ/Eh2HZoL9NZS63UlNqmCAZDWnymYH/RnMasVhXA+NVtQmw6ZzSYVkBnrRQqcg++ 2NNgn9KzGR4/fBPuY2iVR1YmJb0jriAuzHqODzUpGwfexaG9kjiuldYCid8QLUwSyiLZct rNzxMsTTt1G38Vjwg0r1T+TTR2N8pxjXupZGkRXT0SJPIr/vizXPUK0cU06YXA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1594911856; 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=4PnkyZYWZOMwLjT2XEuyBaxyGODDUJAPPfVAnXgJWzM=; b=7ShNmqAVtSMsfGVWqF96OFqo6zG0vv/147EqDPF6TuT2Xpe1h5aN1dSq/v8b6LwN0Hj81f o3O9Jv7/KzbBGvDQ== From: Sebastian Andrzej Siewior To: Uladzislau Rezki Cc: Joel Fernandes , LKML , RCU , linux-mm , "Paul E . McKenney" , Andrew Morton , "Theodore Y . Ts'o" , Matthew Wilcox , Oleksiy Avramchenko Subject: Re: [PATCH 1/1] rcu/tree: Drop the lock before entering to page allocator Message-ID: <20200716150414.iqpyby6nrww4zbyk@linutronix.de> References: <20200715183537.4010-1-urezki@gmail.com> <20200715185628.7b4k3o5efp4gnbla@linutronix.de> <20200716091913.GA28595@pc636> <20200716142537.ecp4icsq7kg6qhdx@linutronix.de> <20200716144728.GA31046@pc636> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200716144728.GA31046@pc636> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-07-16 16:47:28 [+0200], Uladzislau Rezki wrote: > On Thu, Jul 16, 2020 at 04:25:37PM +0200, Sebastian Andrzej Siewior wrote: > > On 2020-07-16 11:19:13 [+0200], Uladzislau Rezki wrote: > > > Sebastian, could you please confirm that if that patch that is in > > > question fixes it? > > > > > > It would be appreciated! > > > > So that preempt disable should in terms any warnings. However I don't > > think that it is strictly needed and from scheduling point of view you > > forbid a CPU migration which might be good otherwise. > > > Please elaborate your point regarding "i do not think it is strictly needed". > > Actually i can rework the patch to remove even such preempt_enable/disable > to stay on the same CPU, but i do not see the point of doing it. > > Do you see the point? You disable preemption for what reason? It is not documented, it is not obvious - why is it required? > As for scheduling point of view. Well, there are many places when there > is a demand in memory or pages from atomic context. Also, getting a page > is not considered as a hot path in the kfree_rcu(). If you disable preemption than you assume that you wouldn't be atomic otherwise. You say that at this point it is not a hot path so if this is not *that* important why not allow preemption and allow the schedule to place you somewhere else if the scheduler decides that it is a good idea. > > Also if interrupts and everything is enabled then someone else might > > invoke kfree_rcu() from BH context for instance. > > > And what? What is a problem here, please elaborate if you see any > issues. That the kfree_rcu() caller from BH context will end up here as well, asking for a page. Sebastian