public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the cgroup tree with the block tree
@ 2011-12-20  6:10 Stephen Rothwell
  2011-12-27 17:41 ` Tejun Heo
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2011-12-20  6:10 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-next, linux-kernel, Jens Axboe

[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]

Hi Tejun,

Today's linux-next merge of the cgroup tree got a conflict in
block/blk-cgroup.c between commit 6e736be7f282 ("block: make ioc get/put
interface more conventional and fix race on alloction") from the block
tree and commit bb9d97b6dffa ("cgroup: don't use subsys->can_attach_task
() or ->attach_task()") from the cgroup tree.

I guessed about fixing it up (see below) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc block/blk-cgroup.c
index 2788693,b8c143d..0000000
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@@ -1641,15 -1648,18 +1648,19 @@@ static int blkiocg_can_attach(struct cg
  	return ret;
  }
  
- static void blkiocg_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
+ static void blkiocg_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
+ 			   struct cgroup_taskset *tset)
  {
+ 	struct task_struct *task;
  	struct io_context *ioc;
  
- 	/* we don't lose anything even if ioc allocation fails */
- 	ioc = get_task_io_context(tsk, GFP_ATOMIC, NUMA_NO_NODE);
- 	if (ioc) {
- 		ioc_cgroup_changed(ioc);
- 		put_io_context(ioc, NULL);
+ 	cgroup_taskset_for_each(task, cgrp, tset) {
 -		task_lock(task);
 -		ioc = task->io_context;
 -		if (ioc)
 -			ioc->cgroup_changed = 1;
 -		task_unlock(task);
++		/* we don't lose anything even if ioc allocation fails */
++		ioc = get_task_io_context(task, GFP_ATOMIC, NUMA_NO_NODE);
++		if (ioc) {
++			ioc_cgroup_changed(ioc);
++			put_io_context(ioc, NULL);
++		}
  	}
  }
  

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the cgroup tree with the block tree
  2011-12-20  6:10 Stephen Rothwell
@ 2011-12-27 17:41 ` Tejun Heo
  0 siblings, 0 replies; 6+ messages in thread
From: Tejun Heo @ 2011-12-27 17:41 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Jens Axboe

Hello, Stephen.

On Mon, Dec 19, 2011 at 10:10 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Today's linux-next merge of the cgroup tree got a conflict in
> block/blk-cgroup.c between commit 6e736be7f282 ("block: make ioc get/put
> interface more conventional and fix race on alloction") from the block
> tree and commit bb9d97b6dffa ("cgroup: don't use subsys->can_attach_task
> () or ->attach_task()") from the cgroup tree.
>
> I guessed about fixing it up (see below) and can carry the fix as
> necessary.

Yes, this looks correct to me.  Thank you very much. :)

-- 
tejun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* linux-next: manual merge of the cgroup tree with the block tree
@ 2012-03-07  5:05 Stephen Rothwell
  2012-03-07 19:17 ` Tejun Heo
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2012-03-07  5:05 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-next, linux-kernel, Li Zefan, Tejun Heo, Jens Axboe

[-- Attachment #1: Type: text/plain, Size: 4620 bytes --]

Hi Tejun,

Today's linux-next merge of the cgroup tree got a conflict in
block/blk-cgroup.c between commit 7ee9c5620504 ("blkcg: let blkio_group
point to blkio_cgroup directly") from the block tree and commit
761b3ef50e1c ("cgroup: remove cgroup_subsys argument from callbacks")
from the cgroup tree.

I fixed it up (I hope - see below) and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc block/blk-cgroup.c
index ee962f3,1359d63..0000000
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@@ -33,16 -28,10 +33,13 @@@ static LIST_HEAD(all_q_list)
  struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT };
  EXPORT_SYMBOL_GPL(blkio_root_cgroup);
  
 +static struct blkio_policy_type *blkio_policy[BLKIO_NR_POLICIES];
 +
- static struct cgroup_subsys_state *blkiocg_create(struct cgroup_subsys *,
- 						  struct cgroup *);
- static int blkiocg_can_attach(struct cgroup_subsys *, struct cgroup *,
- 			      struct cgroup_taskset *);
- static void blkiocg_attach(struct cgroup_subsys *, struct cgroup *,
- 			   struct cgroup_taskset *);
- static int blkiocg_pre_destroy(struct cgroup_subsys *, struct cgroup *);
- static void blkiocg_destroy(struct cgroup_subsys *, struct cgroup *);
+ static struct cgroup_subsys_state *blkiocg_create(struct cgroup *);
+ static int blkiocg_can_attach(struct cgroup *, struct cgroup_taskset *);
+ static void blkiocg_attach(struct cgroup *, struct cgroup_taskset *);
++static int blkiocg_pre_destroy(struct cgroup *);
+ static void blkiocg_destroy(struct cgroup *);
  static int blkiocg_populate(struct cgroup_subsys *, struct cgroup *);
  
  /* for encoding cft->private value on file */
@@@ -1571,48 -1545,52 +1568,46 @@@ static int blkiocg_populate(struct cgro
  				ARRAY_SIZE(blkio_files));
  }
  
 -static void blkiocg_destroy(struct cgroup *cgroup)
 +/**
 + * blkiocg_pre_destroy - cgroup pre_destroy callback
-  * @subsys: cgroup subsys
 + * @cgroup: cgroup of interest
 + *
 + * This function is called when @cgroup is about to go away and responsible
 + * for shooting down all blkgs associated with @cgroup.  blkgs should be
 + * removed while holding both q and blkcg locks.  As blkcg lock is nested
 + * inside q lock, this function performs reverse double lock dancing.
 + *
 + * This is the blkcg counterpart of ioc_release_fn().
 + */
- static int blkiocg_pre_destroy(struct cgroup_subsys *subsys,
- 			       struct cgroup *cgroup)
++static int blkiocg_pre_destroy(struct cgroup *cgroup)
  {
  	struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgroup);
 -	unsigned long flags;
 -	struct blkio_group *blkg;
 -	void *key;
 -	struct blkio_policy_type *blkiop;
 -	struct blkio_policy_node *pn, *pntmp;
  
 -	rcu_read_lock();
 -	do {
 -		spin_lock_irqsave(&blkcg->lock, flags);
 +	spin_lock_irq(&blkcg->lock);
  
 -		if (hlist_empty(&blkcg->blkg_list)) {
 -			spin_unlock_irqrestore(&blkcg->lock, flags);
 -			break;
 +	while (!hlist_empty(&blkcg->blkg_list)) {
 +		struct blkio_group *blkg = hlist_entry(blkcg->blkg_list.first,
 +						struct blkio_group, blkcg_node);
 +		struct request_queue *q = blkg->q;
 +
 +		if (spin_trylock(q->queue_lock)) {
 +			blkg_destroy(blkg);
 +			spin_unlock(q->queue_lock);
 +		} else {
 +			spin_unlock_irq(&blkcg->lock);
 +			cpu_relax();
 +			spin_lock(&blkcg->lock);
  		}
 +	}
  
 -		blkg = hlist_entry(blkcg->blkg_list.first, struct blkio_group,
 -					blkcg_node);
 -		key = rcu_dereference(blkg->key);
 -		__blkiocg_del_blkio_group(blkg);
 -
 -		spin_unlock_irqrestore(&blkcg->lock, flags);
 -
 -		/*
 -		 * This blkio_group is being unlinked as associated cgroup is
 -		 * going away. Let all the IO controlling policies know about
 -		 * this event.
 -		 */
 -		spin_lock(&blkio_list_lock);
 -		list_for_each_entry(blkiop, &blkio_list, list) {
 -			if (blkiop->plid != blkg->plid)
 -				continue;
 -			blkiop->ops.blkio_unlink_group_fn(key, blkg);
 -		}
 -		spin_unlock(&blkio_list_lock);
 -	} while (1);
 +	spin_unlock_irq(&blkcg->lock);
 +	return 0;
 +}
  
- static void blkiocg_destroy(struct cgroup_subsys *subsys, struct cgroup *cgroup)
 -	list_for_each_entry_safe(pn, pntmp, &blkcg->policy_list, node) {
 -		blkio_policy_delete_node(pn);
 -		kfree(pn);
 -	}
++static void blkiocg_destroy(struct cgroup *cgroup)
 +{
 +	struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgroup);
  
 -	free_css_id(&blkio_subsys, &blkcg->css);
 -	rcu_read_unlock();
  	if (blkcg != &blkio_root_cgroup)
  		kfree(blkcg);
  }

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the cgroup tree with the block tree
  2012-03-07  5:05 linux-next: manual merge of the cgroup tree with the block tree Stephen Rothwell
@ 2012-03-07 19:17 ` Tejun Heo
  0 siblings, 0 replies; 6+ messages in thread
From: Tejun Heo @ 2012-03-07 19:17 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Li Zefan, Jens Axboe

On Wed, Mar 07, 2012 at 04:05:16PM +1100, Stephen Rothwell wrote:
> Hi Tejun,
> 
> Today's linux-next merge of the cgroup tree got a conflict in
> block/blk-cgroup.c between commit 7ee9c5620504 ("blkcg: let blkio_group
> point to blkio_cgroup directly") from the block tree and commit
> 761b3ef50e1c ("cgroup: remove cgroup_subsys argument from callbacks")
> from the cgroup tree.
> 
> I fixed it up (I hope - see below) and can carry the fix as necessary.

Yeap, looks correct to me.

Thank you very much.

-- 
tejun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* linux-next: manual merge of the cgroup tree with the block tree
@ 2019-06-24  7:52 Stephen Rothwell
  2019-07-09  0:00 ` Stephen Rothwell
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2019-06-24  7:52 UTC (permalink / raw)
  To: Tejun Heo, Jens Axboe
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, Mauro Carvalho Chehab

[-- Attachment #1: Type: text/plain, Size: 1670 bytes --]

Hi all,

Today's linux-next merge of the cgroup tree got a conflict in:

  Documentation/block/bfq-iosched.txt

between commit:

  8060c47ba853 ("block: rename CONFIG_DEBUG_BLK_CGROUP to CONFIG_BFQ_CGROUP_DEBUG")

from the block tree and commit:

  99c8b231ae6c ("docs: cgroup-v1: convert docs to ReST and rename to *.rst")

from the cgroup tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc Documentation/block/bfq-iosched.txt
index f02163fabf80,b2265cf6c9c3..000000000000
--- a/Documentation/block/bfq-iosched.txt
+++ b/Documentation/block/bfq-iosched.txt
@@@ -537,10 -537,10 +537,10 @@@ or io.bfq.weight
  
  As for cgroups-v1 (blkio controller), the exact set of stat files
  created, and kept up-to-date by bfq, depends on whether
 -CONFIG_DEBUG_BLK_CGROUP is set. If it is set, then bfq creates all
 +CONFIG_BFQ_CGROUP_DEBUG is set. If it is set, then bfq creates all
  the stat files documented in
- Documentation/cgroup-v1/blkio-controller.txt. If, instead,
+ Documentation/cgroup-v1/blkio-controller.rst. If, instead,
 -CONFIG_DEBUG_BLK_CGROUP is not set, then bfq creates only the files
 +CONFIG_BFQ_CGROUP_DEBUG is not set, then bfq creates only the files
  blkio.bfq.io_service_bytes
  blkio.bfq.io_service_bytes_recursive
  blkio.bfq.io_serviced

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the cgroup tree with the block tree
  2019-06-24  7:52 Stephen Rothwell
@ 2019-07-09  0:00 ` Stephen Rothwell
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2019-07-09  0:00 UTC (permalink / raw)
  To: Tejun Heo, Jens Axboe
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, Mauro Carvalho Chehab

[-- Attachment #1: Type: text/plain, Size: 2006 bytes --]

Hi all,

On Mon, 24 Jun 2019 17:52:38 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the cgroup tree got a conflict in:
> 
>   Documentation/block/bfq-iosched.txt
> 
> between commit:
> 
>   8060c47ba853 ("block: rename CONFIG_DEBUG_BLK_CGROUP to CONFIG_BFQ_CGROUP_DEBUG")
> 
> from the block tree and commit:
> 
>   99c8b231ae6c ("docs: cgroup-v1: convert docs to ReST and rename to *.rst")
> 
> from the cgroup tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc Documentation/block/bfq-iosched.txt
> index f02163fabf80,b2265cf6c9c3..000000000000
> --- a/Documentation/block/bfq-iosched.txt
> +++ b/Documentation/block/bfq-iosched.txt
> @@@ -537,10 -537,10 +537,10 @@@ or io.bfq.weight
>   
>   As for cgroups-v1 (blkio controller), the exact set of stat files
>   created, and kept up-to-date by bfq, depends on whether
>  -CONFIG_DEBUG_BLK_CGROUP is set. If it is set, then bfq creates all
>  +CONFIG_BFQ_CGROUP_DEBUG is set. If it is set, then bfq creates all
>   the stat files documented in
> - Documentation/cgroup-v1/blkio-controller.txt. If, instead,
> + Documentation/cgroup-v1/blkio-controller.rst. If, instead,
>  -CONFIG_DEBUG_BLK_CGROUP is not set, then bfq creates only the files
>  +CONFIG_BFQ_CGROUP_DEBUG is not set, then bfq creates only the files
>   blkio.bfq.io_service_bytes
>   blkio.bfq.io_service_bytes_recursive
>   blkio.bfq.io_serviced

I am still getting this conflict (the commit ids may have changed).
Just a reminder in case you think Linus may need to know.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-09  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-07  5:05 linux-next: manual merge of the cgroup tree with the block tree Stephen Rothwell
2012-03-07 19:17 ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2019-06-24  7:52 Stephen Rothwell
2019-07-09  0:00 ` Stephen Rothwell
2011-12-20  6:10 Stephen Rothwell
2011-12-27 17:41 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox