Re: [RFC] QoS params patch

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Mark Gross <mgross@...>
Cc: linux-pm <linux-pm@...>, lkml <linux-kernel@...>
Date: Wednesday, September 26, 2007 - 10:24 pm

On Wed, Sep 26, 2007 at 03:40:26PM -0700, Mark Gross wrote:

Your } is in a strange place. It looks like it wants to join its friends
closer to the left margin ;-)


an enum would be better for this, especially as people are likely to add
new types, having to update QOS_NUM_CLASSES each time sucks.

min()/max() instead?

'target' might be a more meaningful variable name.

Just return misc_register(...); ?


This leaks. You'll have to scan down from i and clean up the kstrdup()
per qos_array element. Presently this will only free the first one to fail
registration.


kmalloc() under a spinlock. GFP_KERNEL implies __GFP_WAIT, which can
sleep. Slab debugging would have caught this, too.


And here also, still under the spinlock. You can probably rework the
locking just to protect the list, if you really need it at all, it
doesn't seem to matter anywhere else here.


no if() needed. 


You also didn't spin_unlock_irqrestore() in the error path, so this bails
out with the lock held and IRQs disabled.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] QoS power Management enabling patch set, Mark Gross, (Wed Sep 26, 6:37 pm)
Re: [RFC] QoS power example / hack, Mark Gross, (Wed Sep 26, 6:45 pm)
Re: [RFC] QoS power Management enabling patch set, Mark Gross, (Wed Sep 26, 6:42 pm)
Re: [RFC] QoS params patch, Mark Gross, (Wed Sep 26, 6:40 pm)
Re: [RFC] QoS params patch, Andrew Morton, (Fri Sep 28, 2:25 am)
Re: [RFC] QoS params patch, Mark Gross, (Fri Sep 28, 1:19 pm)
Re: [RFC] QoS params patch, Andrew Morton, (Fri Sep 28, 2:51 pm)
Re: [RFC] QoS params patch, Mark Gross, (Mon Oct 1, 12:11 pm)
Re: [RFC] QoS params patch, Paul Mundt, (Fri Sep 28, 2:41 am)
Re: [RFC] QoS params patch, Mark Gross, (Fri Sep 28, 1:22 pm)
Re: [RFC] QoS params patch, Paul Mundt, (Wed Sep 26, 10:24 pm)
Re: [RFC] QoS params patch, Mark Gross, (Thu Sep 27, 12:21 pm)
Re: [RFC] QoS params patch, Randy Dunlap, (Thu Sep 27, 12:05 am)
Re: [RFC] QoS params patch update., Mark Gross, (Thu Sep 27, 4:17 pm)
Re: [RFC] QoS params patch update., Paul Mundt, (Thu Sep 27, 8:08 pm)
Re: [RFC] QoS params patch, Mark Gross, (Thu Sep 27, 11:37 am)
Re: [RFC] QoS params patch, Randy Dunlap, (Wed Sep 26, 7:41 pm)
Re: [RFC] QoS params patch, Mark Gross, (Wed Sep 26, 8:40 pm)
Re: [RFC] QoS params patch, roel, (Thu Sep 27, 9:00 am)
Re: [RFC] QoS params patch, , (Wed Sep 26, 10:53 pm)
Re: [RFC] QoS params patch, Mark Gross, (Thu Sep 27, 11:36 am)
Re: [RFC] QoS params patch, Paul Mundt, (Wed Sep 26, 11:18 pm)
Re: [RFC] QoS params patch, Mark Gross, (Thu Sep 27, 11:17 am)