All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Stephen Boyd <sboyd@kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Anna-Maria Gleixner <anna-maria@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v4a 00/38] timers: Use timer_shutdown*() before freeing timers
Date: Sun, 6 Nov 2022 11:05:14 +0800 (+08)	[thread overview]
Message-ID: <b52c207c-e7bf-af2e-61d9-116c9e76af86@inria.fr> (raw)
In-Reply-To: <20221105203634.7e0b2e8e@rorschach.local.home>



On Sat, 5 Nov 2022, Steven Rostedt wrote:

> On Sun, 6 Nov 2022 07:08:48 +0800 (+08)
> Julia Lawall <julia.lawall@inria.fr> wrote:
>
> > Various suggestions:
> >
> > 1.  On your ... put when strict and then on a separate line put when !=
> > ptr.  The when strict will get rid of the goto problem (usually a
> > desirable feature, but not here) and the when != ptr will be sure that ptr
> > is not used before the free.
>
> You mean ptr->timer.function? because it's allowed to be touched. Only
> this case is weird (and I believe I covered it).
>
> Not sure what you mean by "put when strict" I added:
>
>  ... when strict
>
> Thinking that's what you meant (examples would be easier to understand,
> than descriptions). And it didn't cover the return case. Does it only
> cover gotos?
>
>   See drivers/net/wireless/intel/iwlwifi/mvm/sta.c for the false positive case:
>
> 	del_timer_sync(&baid_data->session_timer);
> [..]

But there is a kfree_rcu(baid_data, rcu_head); right below.  So it looks
fine?

julia

>         return 0;
>
> out_free:
>         kfree(baid_data);
>         return ret;
> }
>
> That "return 0" should make the match fail.
>
> >
> > 2.  If you want to handle the initialization of the function field, then
> > you can duplicate the rule and add the removal of that assignment in the
> > first one.  This only seems worth it if it is a very common case.
> > Otherwise, I would agree with Linus and just take care of it by hand
> > later.
>
> No, Linus wants the script to not touch the initialization case. That
> is, currently, the script does the conversion (which also initializes
> it), and the timer.function = NULL is just redundant.
>
> What Linus wanted, was my script to do nothing in this case. But I
> figured this part out.
>
> >
> > 3. Running the rule three times seems to me like a reasonable choice.  Or
> > you could duplicate the rule three times.  But that would be more script
> > to read through.  If this is not a common case, though, you could probably
> > also fix the one up later by hand.
>
> Yeah, that's fine.
>
> I'm just looking for how to avoid the goto / return case.
>
> -- Steve
>

  parent reply	other threads:[~2022-11-06  3:05 UTC|newest]

Thread overview: 170+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-05  6:00 [PATCH v4a 00/38] timers: Use timer_shutdown*() before freeing timers Steven Rostedt
2022-11-05  6:00 ` [Bridge] " Steven Rostedt
2022-11-05  6:00 ` Steven Rostedt
2022-11-05  6:00 ` [Intel-wired-lan] " Steven Rostedt
2022-11-05  6:00 ` [Intel-gfx] " Steven Rostedt
2022-11-05  6:00 ` Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 01/38] SUNRPC/xprt: Use del_timer_sync() instead of del_singleshot_timer_sync() Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 02/38] ARM: spear: Do not use timer namespace for timer_shutdown() function Steven Rostedt
2022-11-05  6:00   ` Steven Rostedt
2022-11-05 14:05   ` Guenter Roeck
2022-11-05 14:05     ` Guenter Roeck
2022-11-07  5:46     ` Viresh Kumar
2022-11-07  5:46       ` Viresh Kumar
2022-11-05 18:12   ` Arnd Bergmann
2022-11-05 18:12     ` Arnd Bergmann
2022-11-05  6:00 ` [PATCH v4a 03/38] clocksource/drivers/arm_arch_timer: " Steven Rostedt
2022-11-05  6:00   ` Steven Rostedt
2022-11-05  9:38   ` Marc Zyngier
2022-11-05  9:38     ` Marc Zyngier
2022-11-05 14:07   ` Guenter Roeck
2022-11-05 14:07     ` Guenter Roeck
2022-11-05 14:42     ` Steven Rostedt
2022-11-05 14:42       ` Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 04/38] clocksource/drivers/sp804: " Steven Rostedt
2022-11-05 14:06   ` Guenter Roeck
2022-11-05  6:00 ` [PATCH v4a 05/38] timers: Add timer_shutdown_sync() and timer_shutdown() to be called before freeing timers Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 06/38] timers: sh: Use timer_shutdown_sync() before freeing timer Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 07/38] timers: block: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 08/38] timers: ACPI: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 09/38] timers: atm: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 10/38] timers: Bluetooth: " Steven Rostedt
2022-11-05  7:14   ` timers: Use timer_shutdown*() before freeing timers bluez.test.bot
2022-11-18  3:47   ` bluez.test.bot
2022-11-18  4:33   ` bluez.test.bot
2022-11-18  5:32   ` bluez.test.bot
2022-11-18  6:34   ` bluez.test.bot
2022-11-18  7:33   ` bluez.test.bot
2022-11-18  8:33   ` bluez.test.bot
2022-11-18  9:30   ` bluez.test.bot
2022-11-19  3:56   ` bluez.test.bot
2022-11-19  5:03   ` bluez.test.bot
2022-11-05  6:00 ` [PATCH v4a 11/38] timers: drm: Use timer_shutdown_sync() before freeing timer Steven Rostedt
2022-11-05  6:00   ` [Intel-gfx] " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 12/38] timers: HID: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 14/38] timers: mISDN: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 15/38] timers: leds: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 16/38] timers: media: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 17/38] timers: net: " Steven Rostedt
2022-11-05  6:00   ` [Bridge] " Steven Rostedt
2022-11-05  6:00   ` Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 18/38] timers: usb: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 19/38] timers: nfc: pn533: " Steven Rostedt
2022-11-07 10:13   ` Krzysztof Kozlowski
2022-11-05  6:00 ` [PATCH v4a 20/38] timers: pcmcia: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 21/38] timers: scsi: Use timer_shutdown_sync() and timer_shutdown() " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 22/38] timers: tty: Use timer_shutdown_sync() " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 23/38] timers: ext4: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 24/38] timers: fs/nilfs2: " Steven Rostedt
2022-11-05  6:00   ` Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 25/38] timers: ALSA: " Steven Rostedt
2022-11-05  6:00   ` Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 26/38] timers: jbd2: Use timer_shutdown() " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 27/38] timers: sched/psi: Use timer_shutdown_sync() " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 28/38] timers: workqueue: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 29/38] random: use timer_shutdown_sync() for on stack timers Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 30/38] timers: dma-buf: Use " Steven Rostedt
2022-11-07 14:12   ` Christian König
2022-11-07 14:12     ` Christian König
2022-11-05  6:00 ` [PATCH v4a 31/38] timers: drm: " Steven Rostedt
2022-11-05  6:00   ` [Intel-gfx] " Steven Rostedt
2022-11-05  9:54   ` Noralf Trønnes
2022-11-05  9:54     ` [Intel-gfx] " Noralf Trønnes
2022-11-05  9:54     ` Noralf Trønnes
2022-11-05  6:00 ` [PATCH v4a 32/38] timers: media: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 33/38] timers: s390/cmm: Use timer_shutdown_sync() before a module is released Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 34/38] timers: atm: " Steven Rostedt
2022-11-05  6:00 ` [PATCH v4a 35/38] timers: hangcheck: " Steven Rostedt
2022-11-05  6:01 ` [PATCH v4a 36/38] timers: ipmi: " Steven Rostedt
2022-11-05  6:01 ` [PATCH v4a 38/38] timers: PM: Use timer_shutdown_sync() Steven Rostedt
2022-11-05 14:18 ` [PATCH v4a 00/38] timers: Use timer_shutdown*() before freeing timers Guenter Roeck
2022-11-05 14:18   ` [Bridge] " Guenter Roeck
2022-11-05 14:18   ` Guenter Roeck
2022-11-05 14:18   ` [Intel-wired-lan] " Guenter Roeck
2022-11-05 14:18   ` [Intel-gfx] " Guenter Roeck
2022-11-05 14:18   ` Guenter Roeck
2022-11-05 14:47   ` Steven Rostedt
2022-11-05 14:47     ` [Bridge] " Steven Rostedt
2022-11-05 14:47     ` Steven Rostedt
2022-11-05 14:47     ` [Intel-wired-lan] " Steven Rostedt
2022-11-05 14:47     ` [Intel-gfx] " Steven Rostedt
2022-11-05 14:47     ` Steven Rostedt
2022-11-05 15:59 ` Linus Torvalds
2022-11-05 15:59   ` [Bridge] " Linus Torvalds
2022-11-05 15:59   ` Linus Torvalds
2022-11-05 15:59   ` Linus Torvalds
2022-11-05 15:59   ` [Intel-wired-lan] " Linus Torvalds
2022-11-05 15:59   ` [Intel-gfx] " Linus Torvalds
2022-11-05 16:36   ` Steven Rostedt
2022-11-05 16:36     ` [Bridge] " Steven Rostedt
2022-11-05 16:36     ` Steven Rostedt
2022-11-05 16:36     ` [Intel-wired-lan] " Steven Rostedt
2022-11-05 16:36     ` [Intel-gfx] " Steven Rostedt
2022-11-05 16:36     ` Steven Rostedt
2022-11-05 16:53     ` Steven Rostedt
2022-11-05 16:53       ` [Bridge] " Steven Rostedt
2022-11-05 16:53       ` Steven Rostedt
2022-11-05 16:53       ` [Intel-wired-lan] " Steven Rostedt
2022-11-05 16:53       ` [Intel-gfx] " Steven Rostedt
2022-11-05 16:53       ` Steven Rostedt
2022-11-05 18:03     ` Steven Rostedt
2022-11-05 18:03       ` [Bridge] " Steven Rostedt
2022-11-05 18:03       ` Steven Rostedt
2022-11-05 18:03       ` [Intel-wired-lan] " Steven Rostedt
2022-11-05 18:03       ` [Intel-gfx] " Steven Rostedt
2022-11-05 18:03       ` Steven Rostedt
2022-11-05 18:05       ` Steven Rostedt
2022-11-05 18:05         ` [Bridge] " Steven Rostedt
2022-11-05 18:05         ` Steven Rostedt
2022-11-05 18:05         ` [Intel-wired-lan] " Steven Rostedt
2022-11-05 18:05         ` [Intel-gfx] " Steven Rostedt
2022-11-05 18:05         ` Steven Rostedt
2022-11-05 18:28       ` Linus Torvalds
2022-11-05 18:28         ` [Bridge] " Linus Torvalds
2022-11-05 18:28         ` Linus Torvalds
2022-11-05 18:28         ` Linus Torvalds
2022-11-05 18:28         ` [Intel-wired-lan] " Linus Torvalds
2022-11-05 18:28         ` [Intel-gfx] " Linus Torvalds
2022-11-05 18:43         ` Steven Rostedt
2022-11-05 23:08           ` Julia Lawall
2022-11-06  0:36             ` Steven Rostedt
2022-11-06  2:38               ` Julia Lawall
2022-11-06  3:05               ` Julia Lawall [this message]
2022-11-06  3:12                 ` Steven Rostedt
2022-11-06  3:15                   ` Julia Lawall
2022-11-05 21:03     ` Jason A. Donenfeld
2022-11-05 21:03       ` [Bridge] " Jason A. Donenfeld
2022-11-05 21:03       ` Jason A. Donenfeld
2022-11-05 21:03       ` [Intel-wired-lan] " Jason A. Donenfeld
2022-11-05 21:03       ` [Intel-gfx] " Jason A. Donenfeld
2022-11-05 21:03       ` Jason A. Donenfeld
2022-11-05 21:13       ` Linus Torvalds
2022-11-05 21:13         ` [Bridge] " Linus Torvalds
2022-11-05 21:13         ` Linus Torvalds
2022-11-05 21:13         ` [Intel-gfx] " Linus Torvalds
2022-11-05 21:13         ` [Intel-wired-lan] " Linus Torvalds
2022-11-05 21:13         ` Linus Torvalds
2022-11-05 21:45         ` Steven Rostedt
2022-11-05 21:45           ` [Bridge] " Steven Rostedt
2022-11-05 21:45           ` Steven Rostedt
2022-11-05 21:45           ` [Intel-wired-lan] " Steven Rostedt
2022-11-05 21:45           ` [Intel-gfx] " Steven Rostedt
2022-11-05 21:45           ` Steven Rostedt
2022-11-05 21:47         ` Steven Rostedt
2022-11-05 21:47           ` [Bridge] " Steven Rostedt
2022-11-05 21:47           ` Steven Rostedt
2022-11-05 21:47           ` [Intel-wired-lan] " Steven Rostedt
2022-11-05 21:47           ` [Intel-gfx] " Steven Rostedt
2022-11-05 21:47           ` Steven Rostedt
2022-11-05 17:53   ` Steven Rostedt
2022-11-05 17:53     ` [Bridge] " Steven Rostedt
2022-11-05 17:53     ` Steven Rostedt
2022-11-05 17:53     ` [Intel-wired-lan] " Steven Rostedt
2022-11-05 17:53     ` [Intel-gfx] " Steven Rostedt
2022-11-05 17:53     ` Steven Rostedt
2022-11-05 19:31 ` Guenter Roeck
2022-11-05 19:31   ` [Bridge] " Guenter Roeck
2022-11-05 19:31   ` Guenter Roeck
2022-11-05 19:31   ` [Intel-wired-lan] " Guenter Roeck
2022-11-05 19:31   ` [Intel-gfx] " Guenter Roeck
2022-11-05 19:31   ` Guenter Roeck

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=b52c207c-e7bf-af2e-61d9-116c9e76af86@inria.fr \
    --to=julia.lawall@inria.fr \
    --cc=akpm@linux-foundation.org \
    --cc=anna-maria@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=rostedt@goodmis.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.