2009-07-27 05:48:23

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: drbd tree build failure

Hi Philipp,

Today's linux-next build (x86_64 allmodconfig) failed like this:

drivers/block/drbd/drbd_main.c: In function 'drbd_thread_current_set_cpu':
drivers/block/drbd/drbd_main.c:1592: error: implicit declaration of function 'set_cpus_allowed'

Introduced by commit 8a4ebc3fbd90072ac870064a930fe612eea6d9a1 ("DRBD:
main") from the drbd interacting with commit
84cf7f02712e3491fb9776f950a8c4f413204c8b
("cpumask:remove-set_cpus_allowed") from the rr tree.

I am not sure what the transformation to the new infrastructure is here -
maybe Rusty can help?

For today, I have reverted the rr tree commit above but we need a better
solution.
--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (745.00 B)
(No filename) (197.00 B)
Download all attachments

2009-07-27 08:09:59

by Lars Ellenberg

[permalink] [raw]
Subject: Re: linux-next: drbd tree build failure

On Mon, Jul 27, 2009 at 03:48:16PM +1000, Stephen Rothwell wrote:
> Hi Philipp,
>
> Today's linux-next build (x86_64 allmodconfig) failed like this:
>
> drivers/block/drbd/drbd_main.c: In function 'drbd_thread_current_set_cpu':
> drivers/block/drbd/drbd_main.c:1592: error: implicit declaration of function 'set_cpus_allowed'
>
> Introduced by commit 8a4ebc3fbd90072ac870064a930fe612eea6d9a1 ("DRBD:
> main") from the drbd interacting with commit
> 84cf7f02712e3491fb9776f950a8c4f413204c8b
> ("cpumask:remove-set_cpus_allowed") from the rr tree.
>
> I am not sure what the transformation to the new infrastructure is here -
> maybe Rusty can help?
>
> For today, I have reverted the rr tree commit above but we need a better
> solution.

I think we can easily use set_cpus_allowed_ptr() instead,
as in fact, we do not have the cpu mask on the stack.
But embeded in struct drbd_conf.


--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD? and LINBIT? are registered trademarks of LINBIT, Austria.

2009-07-27 17:17:58

by Philipp Reisner

[permalink] [raw]
Subject: Re: linux-next: drbd tree build failure

On Monday 27 July 2009 10:09:57 Lars Ellenberg wrote:
> On Mon, Jul 27, 2009 at 03:48:16PM +1000, Stephen Rothwell wrote:
> > Hi Philipp,
> >
> > Today's linux-next build (x86_64 allmodconfig) failed like this:
> >
> > drivers/block/drbd/drbd_main.c: In function
> > 'drbd_thread_current_set_cpu': drivers/block/drbd/drbd_main.c:1592:
> > error: implicit declaration of function 'set_cpus_allowed'
> >
> > Introduced by commit 8a4ebc3fbd90072ac870064a930fe612eea6d9a1 ("DRBD:
> > main") from the drbd interacting with commit
> > 84cf7f02712e3491fb9776f950a8c4f413204c8b
> > ("cpumask:remove-set_cpus_allowed") from the rr tree.
> >
> > I am not sure what the transformation to the new infrastructure is here -
> > maybe Rusty can help?
> >
> > For today, I have reverted the rr tree commit above but we need a better
> > solution.
>
> I think we can easily use set_cpus_allowed_ptr() instead,
> as in fact, we do not have the cpu mask on the stack.
> But embeded in struct drbd_conf.

Ok. Lars' patch is now complete and arrived in the git tree...

It should build now with Rusty's paches.

-phil
--
: Dipl-Ing Philipp Reisner
: LINBIT | Your Way to High Availability
: Tel: +43-1-8178292-50, Fax: +43-1-8178292-82
: http://www.linbit.com

DRBD(R) and LINBIT(R) are registered trademarks of LINBIT, Austria.

2009-07-28 04:20:46

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: drbd tree build failure

Hi Philipp, Lars,

On Mon, 27 Jul 2009 19:17:55 +0200 Philipp Reisner <[email protected]> wrote:
>
> Ok. Lars' patch is now complete and arrived in the git tree...
>
> It should build now with Rusty's paches.

Thanks.

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (332.00 B)
(No filename) (197.00 B)
Download all attachments

2009-07-29 01:41:00

by Rusty Russell

[permalink] [raw]
Subject: Re: linux-next: drbd tree build failure

On Tue, 28 Jul 2009 01:50:40 pm Stephen Rothwell wrote:
> Hi Philipp, Lars,
>
> On Mon, 27 Jul 2009 19:17:55 +0200 Philipp Reisner <[email protected]> wrote:
> >
> > Ok. Lars' patch is now complete and arrived in the git tree...
> >
> > It should build now with Rusty's paches.
>
> Thanks.
>

This is untested, but fairly trivial transform to avoid cpumask_t in the struct
as well:

Subject: drdb: use cpumask_var_t in struct drdb_conf

Any code which can be compiled on x86 should try to avoid cpumask_t
(or even struct cpumask) declarations; we are heading towards struct
cpumask being undefined if CONFIG_CPUMASK_OFFSTACK.

The code is the same for CONFIG_CPUMASK_OFFSTACK=n.

Signed-off-by: Rusty Russell <[email protected]>

diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 5813d7d..10fa153 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -1006,7 +1006,7 @@ struct drbd_conf {
spinlock_t peer_seq_lock;
unsigned int minor;
unsigned long comm_bm_set; /* communicated number of set bits. */
- cpumask_t cpu_mask;
+ cpumask_var_t cpu_mask;
struct bm_io_work bm_io_work;
u64 ed_uuid; /* UUID of the exposed data */
struct mutex state_mutex;
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 20f4d40..9c85a4b 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1550,18 +1550,18 @@ void drbd_calc_cpu_mask(struct drbd_conf *mdev)
int ord, cpu;

/* user override. */
- if (cpumask_weight(&mdev->cpu_mask))
+ if (cpumask_weight(mdev->cpu_mask))
return;

ord = mdev_to_minor(mdev) % cpumask_weight(cpu_online_mask);
for_each_online_cpu(cpu) {
if (ord-- == 0) {
- cpumask_set_cpu(cpu, &mdev->cpu_mask);
+ cpumask_set_cpu(cpu, mdev->cpu_mask);
return;
}
}
/* should not be reached */
- cpumask_setall(&mdev->cpu_mask);
+ cpumask_setall(mdev->cpu_mask);
}

/**
@@ -1584,7 +1584,7 @@ void drbd_thread_current_set_cpu(struct drbd_conf *mdev)
if (!thi->reset_cpu_mask)
return;
thi->reset_cpu_mask = 0;
- set_cpus_allowed_ptr(p, &mdev->cpu_mask);
+ set_cpus_allowed_ptr(p, mdev->cpu_mask);
}
#endif

@@ -3001,6 +3001,8 @@ struct drbd_conf *drbd_new_device(unsigned int minor)
mdev = kzalloc(sizeof(struct drbd_conf), GFP_KERNEL);
if (!mdev)
return NULL;
+ if (!zalloc_cpumask_var(&mdev->cpu_mask, GFP_KERNEL))
+ goto out_no_cpumask;

mdev->minor = minor;

@@ -3079,6 +3081,8 @@ out_no_io_page:
out_no_disk:
blk_cleanup_queue(q);
out_no_q:
+ free_cpumask_var(mdev->cpu_mask);
+out_no_cpumask:
kfree(mdev);
return NULL;
}
@@ -3095,6 +3099,7 @@ void drbd_free_mdev(struct drbd_conf *mdev)
__free_page(mdev->md_io_page);
put_disk(mdev->vdisk);
blk_cleanup_queue(mdev->rq_queue);
+ free_cpumask_var(mdev->cpu_mask);
kfree(mdev);
}

diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 936ec73..ede19be 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1657,8 +1657,8 @@ static int drbd_nl_syncer_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *n
if (mdev->state.conn >= C_CONNECTED)
drbd_send_sync_param(mdev, &sc);

- if (!cpumask_equal(&mdev->cpu_mask, new_cpu_mask)) {
- cpumask_copy(&mdev->cpu_mask, new_cpu_mask);
+ if (!cpumask_equal(mdev->cpu_mask, new_cpu_mask)) {
+ cpumask_copy(mdev->cpu_mask, new_cpu_mask);
drbd_calc_cpu_mask(mdev);
mdev->receiver.reset_cpu_mask = 1;
mdev->asender.reset_cpu_mask = 1;

2009-07-29 15:11:25

by Philipp Reisner

[permalink] [raw]
Subject: Re: linux-next: drbd tree build failure

On Wednesday 29 July 2009 03:40:55 Rusty Russell wrote:
> On Tue, 28 Jul 2009 01:50:40 pm Stephen Rothwell wrote:
> > Hi Philipp, Lars,
> >
> > On Mon, 27 Jul 2009 19:17:55 +0200 Philipp Reisner
<[email protected]> wrote:
> > > Ok. Lars' patch is now complete and arrived in the git tree...
> > >
> > > It should build now with Rusty's paches.
> >
> > Thanks.
>
> This is untested, but fairly trivial transform to avoid cpumask_t in the
> struct as well:
>

Thanks,

I have commited that patch to the DRBD git tree.

-phil
--
: Dipl-Ing Philipp Reisner
: LINBIT | Your Way to High Availability
: Tel: +43-1-8178292-50, Fax: +43-1-8178292-82
: http://www.linbit.com

DRBD(R) and LINBIT(R) are registered trademarks of LINBIT, Austria.