Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1630433yba; Tue, 2 Apr 2019 12:35:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXTJiAItYFD/iNCVPj3XCGD/rOUQ8ZtGAIFH7S5k6sO4b6B0AEECKiuFOt/dK0kzICSu33 X-Received: by 2002:aa7:86ce:: with SMTP id h14mr21517089pfo.84.1554233745424; Tue, 02 Apr 2019 12:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554233745; cv=none; d=google.com; s=arc-20160816; b=fGa27XSF050E+FwBI5ZE0py+kGVsWtz+cGszGmj3HMgDF9p+XoUyogeF+dgDEuplg/ MZV8+70Bk84fg1xcj5bJQI/e9P4MyFhyFCOtaXhUWp7z7RepnFijM52Z8+SxcmaYUh8D FIhzzVnXKgrGlyyHJDZXx8RLbJAGxWM8WNo9wpMVfiVCvpSE3zHqYvgFbJLjAudnSpeL dUz3YXxyGxh2FjrFlzREIFc4QM9iXZvT3gveMXRJOnObeWuLZzKn7s+7iyXAe67AWa9o 6QM4tHvdLpcD9/T21O4d9LSRdTms/VE6nZ7m8aL/3UIqy7XIvbsnPdMSL8XpDQmFoUce kgxw== 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=QX3WmO3z+LdgwO9J+1/fdWqAW7fq2Y7yHthIv1sOONg=; b=ojEu5ji8yxxb29T33VPXRqCnEU5rSH3ueIL9EHMiPHvTIzv1V/abu41l1fuppWdutO 75CL/Aq5gWOPEc6jE+xD6cow9rjBGeTEhqBOV0FkTgRtkG1UknGJIa2VK6GnCuKcdWvR emltnw/R6PTSgMILnAjaZKoJFjYDFp3aKffvb+lqcxM+MOBwLfBSN8cYNqjVdPZ4wuGQ ocGpYIQp2KOO6Hd4+n0qQuZlIMq3CAO/q2+eY9Oe7sSvYU970S0WGrNSim/+aP9+IYbu 9ErmV6TJYBH7natD5mH85Pg4Of9jL1Z19W1l12LIPmP2SuqcJzAFcsDUTiuo/k5I+I/t FfQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=TwFtjGnU; 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 v10si12511959pgj.576.2019.04.02.12.35.29; Tue, 02 Apr 2019 12:35:45 -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=@joelfernandes.org header.s=google header.b=TwFtjGnU; 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 S1728359AbfDBSk6 (ORCPT + 99 others); Tue, 2 Apr 2019 14:40:58 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33572 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726524AbfDBSk5 (ORCPT ); Tue, 2 Apr 2019 14:40:57 -0400 Received: by mail-pf1-f193.google.com with SMTP id i19so6811943pfd.0 for ; Tue, 02 Apr 2019 11:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QX3WmO3z+LdgwO9J+1/fdWqAW7fq2Y7yHthIv1sOONg=; b=TwFtjGnUlRbjWg0cZuXgTNn/4lVvzivuxSUKmM36CR7cn0oCDHcVMle8OhW36i9gdk KmOkbU0ZiipElWNJ/WkGlhTTG80uUIJqYRCoczQGZR9EN+E/ywrk0DyhcwJDT84H1Yye IejTpRJewdlen5AqRGgIq64rvLFmU2G5msri8= 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=QX3WmO3z+LdgwO9J+1/fdWqAW7fq2Y7yHthIv1sOONg=; b=lqKuCQau4Gyucfn6zPTx72CLebUgku50X+j6PtW9VQ0yIP7TAxmO84t6bktsn26a2b jPdFdbYRVQG8AEJXetjakaoJY1u8V0lYP2Fhj8ZQBkyptaOlrUARQTvVdxDBRQSrMvSP xWxw+AnzwqyPVzwWNfk6iolK2rexx0yetjPw9S7IaHyYKp1xeZzZQ0hCbTQd0Veo2HaK JR3jD6gxEpcm88F1KwP6gbEwI6NvLPYR8mahbqOdKYL//XtyY6EWAQvQ7zkigLDTaKok 9notFQWRJPIJc4xb72cuUXhfmcOUwRc9QdJF7PEXjc1F7/Ln++HqQRd0xJy9LTuMuouv dWCA== X-Gm-Message-State: APjAAAWgn7sdgP+Ol9Xuut45A8KpjMqHYoKofxYIOtqQvbyqvyarUaHl oyq66V7t46WaC92eItW3NGwLcQ== X-Received: by 2002:a63:e402:: with SMTP id a2mr59794423pgi.268.1554230456850; Tue, 02 Apr 2019 11:40:56 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id v82sm31468142pfa.170.2019.04.02.11.40.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Apr 2019 11:40:55 -0700 (PDT) Date: Tue, 2 Apr 2019 14:40:54 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: Mathieu Desnoyers , rcu@vger.kernel.org, linux-kernel , Ingo Molnar , Lai Jiangshan , dipankar , Andrew Morton , Josh Triplett , Thomas Gleixner , Peter Zijlstra , rostedt , David Howells , Eric Dumazet , fweisbec , Oleg Nesterov , linux-nvdimm@lists.01.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: Re: [PATCH RFC tip/core/rcu 0/4] Forbid static SRCU use in modules Message-ID: <20190402184054.GA18150@google.com> References: <20190402142816.GA13084@linux.ibm.com> <886051277.1395.1554218080591.JavaMail.zimbra@efficios.com> <20190402152334.GC4102@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190402152334.GC4102@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 02, 2019 at 08:23:34AM -0700, Paul E. McKenney wrote: > On Tue, Apr 02, 2019 at 11:14:40AM -0400, Mathieu Desnoyers wrote: > > ----- On Apr 2, 2019, at 10:28 AM, paulmck paulmck@linux.ibm.com wrote: > > > > > Hello! > > > > > > This series prohibits use of DEFINE_SRCU() and DEFINE_STATIC_SRCU() > > > by loadable modules. The reason for this prohibition is the fact > > > that using these two macros within modules requires that the size of > > > the reserved region be increased, which is not something we want to > > > be doing all that often. Instead, loadable modules should define an > > > srcu_struct and invoke init_srcu_struct() from their module_init function > > > and cleanup_srcu_struct() from their module_exit function. Note that > > > modules using call_srcu() will also need to invoke srcu_barrier() from > > > their module_exit function. > > > > This arbitrary API limitation seems weird. > > > > Isn't there a way to allow modules to use DEFINE_SRCU and DEFINE_STATIC_SRCU > > while implementing them with dynamic allocation under the hood ? > > Although call_srcu() already has initialization hooks, some would > also be required in srcu_read_lock(), and I am concerned about adding > memory allocation at that point, especially given the possibility > of memory-allocation failure. And the possibility that the first > srcu_read_lock() happens in an interrupt handler or similar. > > Or am I missing a trick here? Hi Paul, Which 'reserved region' are you referring to? Isn't this region also used for non-module cases in which case the same problem applies to non-modules? thanks! - Joel