Andrew Morton
2013-Aug-28 21:10 UTC
[PATCH] percpu ida: Switch to cpumask_t, add some comments
On Wed, 28 Aug 2013 14:00:10 -0700 Kent Overstreet <kmo at daterainc.com> wrote:> On Wed, Aug 28, 2013 at 01:25:50PM -0700, Andrew Morton wrote: > > On Wed, 28 Aug 2013 12:55:17 -0700 Kent Overstreet <kmo at daterainc.com> wrote: > > > > > Fixup patch, addressing Andrew's review feedback: > > > > Looks reasonable. > > > > > lib/idr.c | 38 +++++++++++++++++++++----------------- > > > > I still don't think it should be in this file. > > > > You say that some as-yet-unmerged patches will tie the new code into > > the old ida code. But will it do it in a manner which requires that > > the two reside in the same file? > > Not require, no - but it's just intimate enough with my ida rewrite that > I think it makes sense; it makes some use of stuff that should be > internal to the ida code. > > Mostly just sharing the lock though, since I got rid of the ida > interfaces that don't do locking, but percpu ida needs a lock that also > covers what ida needs. > > It also makes use of a ganged allocation interface, but there's no real > reason ida can't expose that, it's just unlikely to be useful to > anything but percpu ida. > > The other reason I think it makes sense to live in idr.c is more for > users of the code; as you pointed out as far as the user's perspective > percpu ida isn't doing anything fundamentally different from ida, so I > think it makes sense for the code to live in the same place as a > kindness to future kernel developers who are trying to find their way > around the various library code.I found things to be quite the opposite - it took 5 minutes of staring, head-scratching, double-checking and penny-dropping before I was confident that the newly-added code actually has nothing at all to do with the current code. Putting it in the same file was misleading, and I got misled.
Kent Overstreet
2013-Aug-28 21:23 UTC
[PATCH] percpu ida: Switch to cpumask_t, add some comments
On Wed, Aug 28, 2013 at 02:10:19PM -0700, Andrew Morton wrote:> On Wed, 28 Aug 2013 14:00:10 -0700 Kent Overstreet <kmo at daterainc.com> wrote: > > > On Wed, Aug 28, 2013 at 01:25:50PM -0700, Andrew Morton wrote: > > > On Wed, 28 Aug 2013 12:55:17 -0700 Kent Overstreet <kmo at daterainc.com> wrote: > > > > > > > Fixup patch, addressing Andrew's review feedback: > > > > > > Looks reasonable. > > > > > > > lib/idr.c | 38 +++++++++++++++++++++----------------- > > > > > > I still don't think it should be in this file. > > > > > > You say that some as-yet-unmerged patches will tie the new code into > > > the old ida code. But will it do it in a manner which requires that > > > the two reside in the same file? > > > > Not require, no - but it's just intimate enough with my ida rewrite that > > I think it makes sense; it makes some use of stuff that should be > > internal to the ida code. > > > > Mostly just sharing the lock though, since I got rid of the ida > > interfaces that don't do locking, but percpu ida needs a lock that also > > covers what ida needs. > > > > It also makes use of a ganged allocation interface, but there's no real > > reason ida can't expose that, it's just unlikely to be useful to > > anything but percpu ida. > > > > The other reason I think it makes sense to live in idr.c is more for > > users of the code; as you pointed out as far as the user's perspective > > percpu ida isn't doing anything fundamentally different from ida, so I > > think it makes sense for the code to live in the same place as a > > kindness to future kernel developers who are trying to find their way > > around the various library code. > > I found things to be quite the opposite - it took 5 minutes of staring, > head-scratching, double-checking and penny-dropping before I was > confident that the newly-added code actually has nothing at all to do > with the current code. Putting it in the same file was misleading, and > I got misled.Ok... and I could see how the fact that it currently _doesn't_ have anything to do with the existing code would be confusing... Do you think that if/when it's making use of the ida rewrite it'll be ok? Or would you still prefer to have it in a new file (and if so, any preference on the naming?)
Andrew Morton
2013-Aug-28 21:36 UTC
[PATCH] percpu ida: Switch to cpumask_t, add some comments
On Wed, 28 Aug 2013 14:23:58 -0700 Kent Overstreet <kmo at daterainc.com> wrote:> > I found things to be quite the opposite - it took 5 minutes of staring, > > head-scratching, double-checking and penny-dropping before I was > > confident that the newly-added code actually has nothing at all to do > > with the current code. Putting it in the same file was misleading, and > > I got misled. > > Ok... and I could see how the fact that it currently _doesn't_ have > anything to do with the existing code would be confusing... > > Do you think that if/when it's making use of the ida rewrite it'll be > ok? Or would you still prefer to have it in a new fileI'm constitutionally reluctant to ever assume that any out-of-tree code will be merged. Maybe you'll get hit by a bus, and maybe the code sucks ;) Are you sure that the two things are so tangled together that they must live in the same file? If there's some nice layering between ida and percpu_ida then perhaps such a physical separation would remain appropriate?> (and if so, any preference on the naming?)percpu_ida.c?