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.6 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, URIBL_BLOCKED,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 E4F2AC433E3 for ; Thu, 16 Jul 2020 14:37:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A79982065D for ; Thu, 16 Jul 2020 14:37:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fsolWBi7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A79982065D 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 2A7E48D0002; Thu, 16 Jul 2020 10:37:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 25A066B0096; Thu, 16 Jul 2020 10:37:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 123DF8D0002; Thu, 16 Jul 2020 10:37:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id ECA4B6B0083 for ; Thu, 16 Jul 2020 10:37:28 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6F8B0180AD811 for ; Thu, 16 Jul 2020 14:37:28 +0000 (UTC) X-FDA: 77044192176.12.cork98_180fa8226f03 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id D6C4218073706 for ; Thu, 16 Jul 2020 14:37:19 +0000 (UTC) X-HE-Tag: cork98_180fa8226f03 X-Filterd-Recvd-Size: 5453 Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Thu, 16 Jul 2020 14:37:19 +0000 (UTC) Received: by mail-lf1-f67.google.com with SMTP id c11so3393175lfh.8 for ; Thu, 16 Jul 2020 07:37:19 -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=kcj5G59GOTPUhqEln7W+1LEARocoTm+rR4NtydTtguo=; b=fsolWBi7fEMSttVRztN88vZvdXxpApiO8nGZnGfXBYuEqQm02/VSbeTmuDVv7DvsAF zqUaYfoMi4yCccLUSyZU1zXDHArDXbTwrgozKCgZ2Do4Q4i8AKm6uIQhjIc6WNA4pgXE 4YAKBoHU+7Nq4gKyyIlwrhS64PiKsEmaVRAc6bfeFnRPVFKLH8blfsCtNFgf9mfi+Wf+ YpfzD33ZXXbBkM0bgmbTRmtnCTbsVViWzb17iKY92lDfvXqaZoi4/g8bh2K6wGsei3Fb tu1sexbPoEq/Z2ajTY8Q7OM3XZpYMl3L9y1zSlzKDmU1Ql481NARoEKwDqspLwAKIOVn iTwA== 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=kcj5G59GOTPUhqEln7W+1LEARocoTm+rR4NtydTtguo=; b=QBkVYwBGydv+n7t4Cf7YxdEYiOVuPYIcCBesrFCQO8LLCEri+l4pl0Excvkd3Zj4Td XScc/yKAXip4+Xyq4KgXldlF4/bMe8EMHqOljTjUZs6JxouCa3hRoNIOnLrY/e8TxiHx ACM1K/DI9UBZCVxnl1/ypBYn4PR1jq0sYrmGrwqGkRTnYmrbFOm5eDcmqzu7AQ54mc4C TJCkv+5nYf7LMpi3C0QRPvNDXhDbmEOVBSi5I92MEDYim+h+8OpsszB2iSa/J5u/ZUPC slAGYbGrDd1UXF768iDhCXVIgpa5IdtlgN2uTW9sheHrsBLvs0WpHd2ZNH5+Pi4dNzDE FiQA== X-Gm-Message-State: AOAM531YxlU88YtMPoFi6BM4U+ry0GPXAbvqA05Gu8Ouo1gb3ulxZKpG yjL83mMNnrqjQhWmeEU9AB8= X-Google-Smtp-Source: ABdhPJx4BQ3PHoFUdHg7Bvc8rgLUE3SYrUvOnJNTSabEq9+6seSXFnJKIWATP+/bQpICka1dYxxfow== X-Received: by 2002:a19:43:: with SMTP id 64mr2244338lfa.72.1594910237254; Thu, 16 Jul 2020 07:37:17 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id s62sm1078206lja.100.2020.07.16.07.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 07:37:16 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 16 Jul 2020 16:37:14 +0200 To: Joel Fernandes Cc: Uladzislau Rezki , Sebastian Andrzej Siewior , 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: <20200716143714.GA30965@pc636> References: <20200715183537.4010-1-urezki@gmail.com> <20200715185628.7b4k3o5efp4gnbla@linutronix.de> <20200716091913.GA28595@pc636> <20200716133647.GA242690@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200716133647.GA242690@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: D6C4218073706 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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, Jul 16, 2020 at 09:36:47AM -0400, Joel Fernandes wrote: > On Thu, Jul 16, 2020 at 11:19:13AM +0200, Uladzislau Rezki wrote: > > On Wed, Jul 15, 2020 at 07:13:33PM -0400, Joel Fernandes wrote: > > > On Wed, Jul 15, 2020 at 2:56 PM Sebastian Andrzej Siewior > > > wrote: > > > > > > > > On 2020-07-15 20:35:37 [+0200], Uladzislau Rezki (Sony) wrote: > > > > > @@ -3306,6 +3307,9 @@ kvfree_call_rcu_add_ptr_to_bulk(struct kfree_rcu_cpu *krcp, void *ptr) > > > > > if (IS_ENABLED(CONFIG_PREEMPT_RT)) > > > > > return false; > > > > > > > > > > + preempt_disable(); > > > > > + krc_this_cpu_unlock(*krcp, *flags); > > > > > > > > Now you enter memory allocator with disabled preemption. This isn't any > > > > better but we don't have a warning for this yet. > > > > What happened to the part where I asked for a spinlock_t? > > > > > > Ulad, > > > Wouldn't the replacing of preempt_disable() with migrate_disable() > > > above resolve Sebastian's issue? > > > > > This for regular kernel only. That means that migrate_disable() is > > equal to preempt_disable(). So, no difference. > > But this will force preempt_disable() context into the low-level page > allocator on -RT kernels which I believe is not what Sebastian wants. The > whole reason why the spinlock vs raw-spinlock ordering matters is, because on > RT, the spinlock is sleeping. So if you have: > > raw_spin_lock(..); > spin_lock(..); <-- can sleep on RT, so Sleep while atomic (SWA) violation. > > That's the main reason you are dropping the lock before calling the > allocator. > No. Please read the commit message of this patch. This is for regular kernel. You did a patch: if (IS_ENABLED(CONFIG_PREEMPT_RT)) return false; -- Vlad Rezki