Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7074280ybi; Mon, 22 Jul 2019 06:43:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiSc6DCZ07eau3XDAAEbq8j4nH9CM3pc09pUX33/0K/4yunR0jUQ3uLkengRCQ/5SOv+xi X-Received: by 2002:a17:90b:d8f:: with SMTP id bg15mr77022779pjb.65.1563803001839; Mon, 22 Jul 2019 06:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563803001; cv=none; d=google.com; s=arc-20160816; b=nsi8mStgVeZsMNYJAyLzFyM+pJls6ae2OnpE5+nN6G0JbEGCAjyqFAtWu71qmnpHkX 2c0Ha5KsYDDRIAnk75FgOBmSzp/6seZVPJ5hNACb4tdRb+GBTTiLtXn5OniFG+eFb8jk X5fBWvU8Ssu61tH9bLkeerkT/RNU7Ydkxy21d67GzQ6/XJiDC5ameI8MDhXX5uT+COef bEx6nQW18IAKjt+aE7bhALoEmJpdfI6fLFJnwzO7AR5fg3prK2pwJ9YFxEAdSgEiEpHK tMrne5247eIWn/n++PSOwt3R88AZRexHS7YP7Z3+QhdeNDoglJXA2I8A/bOSKFivMiuH QsQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=r7jurWEbcB87wkHM6FBIF/d6ZCsIeD3qrag1BaWvzr0=; b=ErRfr9pdUeDqlnb8PQt4VJmHhZgFjnGAn4+8sZGuYDiyITJsKzxTVZ9ecXyczUks4d 29n8RamM2ZgCqU5duiqvfbTmkAKtT4oh8Q9f4oVSSWbso81p4tk2XtXBb40jD2vaVc4z 1Io3Of+qsE+/ZWc3e1WNWYV7DFiVRRmuH5T/lw6IcwEiGKiDe0n4sjYvt8ePx52ZS488 xFWYvwYKARisKUfj4f0HkOAkLad85PKXgmfrDOcTzgintveKS1WN/gD2a5y4toN8VS0c K5sXFmusSgL/EZaLOT5glEII3cjdN84/FXOm1WCp/yb5XsXUkWtQALgQJXlr8aIHbXPY 3N+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=ctSiEsOE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i26si479718pgm.250.2019.07.22.06.43.06; Mon, 22 Jul 2019 06:43:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=ctSiEsOE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729298AbfGVNlz (ORCPT + 99 others); Mon, 22 Jul 2019 09:41:55 -0400 Received: from mail-qk1-f176.google.com ([209.85.222.176]:44048 "EHLO mail-qk1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbfGVNlz (ORCPT ); Mon, 22 Jul 2019 09:41:55 -0400 Received: by mail-qk1-f176.google.com with SMTP id d79so28571544qke.11 for ; Mon, 22 Jul 2019 06:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=r7jurWEbcB87wkHM6FBIF/d6ZCsIeD3qrag1BaWvzr0=; b=ctSiEsOEiyiwu0n3CEQABL3/Tosruh5w/+6uzF92xLW34JmyfhThCGBMfVUaYt9dcx eW2R16GiG0XcoxTfHQmNNe2NbtDmD4V4zDlbn3sIafmR+axGp5w7q8jG/t+N5A5vd1+2 T8limk/5bxxJguypRZGjOMgCVjJ3UuJ440SlT4VBiuew99yPu+wjBAGDyiX6h7A0CwOA dwL0M70N/ZKBJ7e/9dDovVWnU15MNgA7ZpwwgLu6rerH2A7rFP/VNIWBW0CDFkWJkGIk 02tVH4RCMUcpMeH+V7LrZ4lwFpUMFWob0uRUx2w20StfeAVPWAbvrasBs/AM3w8QAsz1 Qvkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=r7jurWEbcB87wkHM6FBIF/d6ZCsIeD3qrag1BaWvzr0=; b=EE3YVWRws8tBPLovmiLG6itbMuKa8LNdH5JFG/2/GzWgeDUjihGgrmgINephSezh95 puvh5seFwFgl22HVPcHBh3WKwDBGhBMPBL79x2vRVdgHfDw3niB5jyP5Eqt13GVfxOpQ NIO8miMvSi762B1/dO9RXjUAOhqv8Uav1jMZBnQPHPSNv03SiWkRZIVzMJMD8mn4T58U 6lTHrymHu6aDY9KNRZ8We0uUeM3141yyJNjN3jOjZ9rREe5z0L+jrvde6ngts04Uxi8a Mjv52VmMsPkU4ckCEpO+rN3kqOZOG44QZq5wd9Wnk3CacoY6UVeELFkA+DpAFy6reF3C LYow== X-Gm-Message-State: APjAAAV4PvIg7z8ApqrN8IFiNF5ODUTNIjFMGRuYOGGW66XXWNLQWaXt zD3acuzcEaG5caEkXwYNK1LVLw== X-Received: by 2002:a37:a6d8:: with SMTP id p207mr42748278qke.387.1563802913858; Mon, 22 Jul 2019 06:41:53 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-55-100.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.55.100]) by smtp.gmail.com with ESMTPSA id x8sm17451291qkl.27.2019.07.22.06.41.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jul 2019 06:41:52 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hpYZc-0003Vr-7E; Mon, 22 Jul 2019 10:41:52 -0300 Date: Mon, 22 Jul 2019 10:41:52 -0300 From: Jason Gunthorpe To: "Paul E. McKenney" Cc: "Michael S. Tsirkin" , Matthew Wilcox , aarcange@redhat.com, akpm@linux-foundation.org, christian@brauner.io, davem@davemloft.net, ebiederm@xmission.com, elena.reshetova@intel.com, guro@fb.com, hch@infradead.org, james.bottomley@hansenpartnership.com, jasowang@redhat.com, jglisse@redhat.com, keescook@chromium.org, ldv@altlinux.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, luto@amacapital.net, mhocko@suse.com, mingo@kernel.org, namit@vmware.com, peterz@infradead.org, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk, wad@chromium.org Subject: Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop) Message-ID: <20190722134152.GA13013@ziepe.ca> References: <0000000000008dd6bb058e006938@google.com> <000000000000964b0d058e1a0483@google.com> <20190721044615-mutt-send-email-mst@kernel.org> <20190721081933-mutt-send-email-mst@kernel.org> <20190721131725.GR14271@linux.ibm.com> <20190721210837.GC363@bombadil.infradead.org> <20190721233113.GV14271@linux.ibm.com> <20190722035042-mutt-send-email-mst@kernel.org> <20190722115149.GY14271@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190722115149.GY14271@linux.ibm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 22, 2019 at 04:51:49AM -0700, Paul E. McKenney wrote: > > > > Would it make sense to have call_rcu() check to see if there are many > > > > outstanding requests on this CPU and if so process them before returning? > > > > That would ensure that frequent callers usually ended up doing their > > > > own processing. > > > > > > Unfortunately, no. Here is a code fragment illustrating why: That is only true in the general case though, kfree_rcu() doesn't have this problem since we know what the callback is doing. In general a caller of kfree_rcu() should not need to hold any locks while calling it. We could apply the same idea more generally and have some 'call_immediate_or_rcu()' which has restrictions on the caller's context. I think if we have some kind of problem here it would be better to handle it inside the core code and only require that callers use the correct RCU API. I can think of many places where kfree_rcu() is being used under user control.. Jason