[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190724170237.GD20252@splinter>
Date: Wed, 24 Jul 2019 20:02:37 +0300
From: Ido Schimmel <idosch@...sch.org>
To: Jiri Pirko <jiri@...nulli.us>
Cc: netdev@...r.kernel.org, davem@...emloft.net, nhorman@...driver.com,
dsahern@...il.com, roopa@...ulusnetworks.com,
nikolay@...ulusnetworks.com, jakub.kicinski@...ronome.com,
toke@...hat.com, andy@...yhouse.net, f.fainelli@...il.com,
andrew@...n.ch, vivien.didelot@...il.com, mlxsw@...lanox.com,
Ido Schimmel <idosch@...lanox.com>
Subject: Re: [RFC PATCH net-next 08/12] drop_monitor: Initialize timer and
work item upon tracing enable
On Wed, Jul 24, 2019 at 11:01:20AM +0200, Jiri Pirko wrote:
> Mon, Jul 22, 2019 at 08:31:30PM CEST, idosch@...sch.org wrote:
> > static int net_dm_trace_on_set(struct netlink_ext_ack *extack)
> > {
> >- int rc;
> >+ int cpu, rc;
> >
> > if (!try_module_get(THIS_MODULE)) {
> > NL_SET_ERR_MSG_MOD(extack, "Failed to take reference on module");
> > return -ENODEV;
> > }
> >
> >+ for_each_possible_cpu(cpu) {
> >+ struct per_cpu_dm_data *data = &per_cpu(dm_cpu_data, cpu);
> >+
> >+ INIT_WORK(&data->dm_alert_work, send_dm_alert);
> >+ timer_setup(&data->send_timer, sched_send_work, 0);
>
> So don't you want to remove this initialization from
> init_net_drop_monitor?
It's actually needed because it calls reset_per_cpu_data(), which might
trigger the timer on memory allocation error. I'll try to see if I can
get rid of it. If not, I'll add a comment so that people won't be
tempted to remove it.
Powered by blists - more mailing lists