Re: [RFC] Raceless module interface

From: Daniel Phillips (
Date: Fri Sep 13 2002 - 12:12:13 EST

On Friday 13 September 2002 18:39, Thunder from the hill wrote:
> Hi,
> On Fri, 13 Sep 2002, Daniel Phillips wrote:
> > That's debatable. Arguably, a failed ->module_cleanup() should be
> > retried on every rmmod -a, but expecting module.c to just keep
> > retrying mindlessly on its own sounds too much like a busy wait.
> Hmmm. You might as well give it back to the user.
> rmmod: remove failed: do it again!

That's what happens now. We can certainly improve the error message,
and actually, that just falls out, from properly adding an error
return code to ->cleanup_module()

> So the cleanup code could as well just do it on its own.


> > > Why is that sloppy? E.g. kfree() happily accepts NULL pointers as well.
> >
> > That is sloppy. Different discussion.
> What should kfree do in your opinion? BUG()?


static inline void kfree_test(void *object)
        if (object)

#define kfree_sloppy kfree_test


(But see "different discussion" above.)

> doodle.c:12: attempted to free NULL pointer, as you know it already is.

Um. You know it's NULL and you freed it anyway?

(But see "different discussion" above.)

> > I take it that the points you didn't reply to are points that you
> > agree with? (The main point being, that we both advocate a simple,
> > two-method interface for module load/unload.)
> You could even do it using three methods.

Yes, or two, my favorite.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Sep 15 2002 - 22:00:34 EST