From: Corey Minyard <cminyard@mvista.com>
To: paulmck@linux.ibm.com, Tejun Heo <tj@kernel.org>
Cc: Angel Shtilianov <angel.shtilianov@siteground.com>,
linux-mm@kvack.org, dennis@kernel.org, cl@linux.com,
jeyu@kernel.org
Subject: Re: Ipmi modules and linux-4.19.1
Date: Thu, 20 Dec 2018 15:59:14 -0600 [thread overview]
Message-ID: <76ae72b7-4dea-68c0-7d54-62055eec3ceb@mvista.com> (raw)
In-Reply-To: <20181220162225.GC4170@linux.ibm.com>
On 12/20/18 10:22 AM, Paul E. McKenney wrote:
> On Thu, Dec 20, 2018 at 08:05:14AM -0800, Tejun Heo wrote:
>> Hello,
>>
>> On Thu, Dec 20, 2018 at 08:04:08AM -0800, Paul E. McKenney wrote:
>>>> Yes, it is possible. Just do something like this:
>>>>
>>>> struct srcu_struct my_srcu_struct;
>>>>
>>>> And before the first use of my_srcu_struct, do this:
>>>>
>>>> init_srcu_struct(&my_srcu_struct);
>>>>
>>>> This will result in alloc_percpu() being invoked to allocate the
>>>> needed per-CPU space.
>>>>
>>>> If my_srcu_struct is used in a module or some such, then to avoid memory
>>>> leaks, after the last use of my_srcu_struct, do this:
>>>>
>>>> cleanup_srcu_struct(&my_srcu_struct);
>>>>
>>>> There are several places in the kernel that take this approach.
>> Oops, my bad. Somehow I thought the dynamic init didn't exist (I
>> checked the header but somehow completely skipped over them). Thanks
>> for the explanation!
> No problem, especially given that if things go as they usually do, I
> will provide you ample opportunity to return the favor. ;-)
Ok, I didn't realize that SRCU took up so much space. It's true that
this isn't
something that requires performance, but SRCU was awfully convenient to
use for this.
Unfortunately, it's not just a matter of adding the init_srcu_struct()
to the
__init function. I'm going to have to hunt down all the initial startup
points
and add it there, and rework some of the other initialization code..
But that's
something I can do.
Unless someone else would rather do it :-).
-corey
prev parent reply other threads:[~2018-12-20 21:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-20 7:55 Angel Shtilianov
2018-12-20 15:42 ` Tejun Heo
2018-12-20 16:00 ` Tejun Heo
2018-12-20 16:03 ` Paul E. McKenney
2018-12-20 16:04 ` Paul E. McKenney
2018-12-20 16:05 ` Tejun Heo
2018-12-20 16:22 ` Paul E. McKenney
2018-12-20 21:59 ` Corey Minyard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=76ae72b7-4dea-68c0-7d54-62055eec3ceb@mvista.com \
--to=cminyard@mvista.com \
--cc=angel.shtilianov@siteground.com \
--cc=cl@linux.com \
--cc=dennis@kernel.org \
--cc=jeyu@kernel.org \
--cc=linux-mm@kvack.org \
--cc=paulmck@linux.ibm.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox