aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-11-02 14:25:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-11-02 14:25:48 -0400
commit5f21585384a4a69b8bfdd2cae7e3648ae805f57d (patch)
treeb976d6e847b7209fb54cf78821a59951a7e9e8cd /kernel
parentfcc37f76a995cc08546b88b83f9bb5da11307a0b (diff)
parent9fe5c59ff6a1e5e26a39b75489a1420e7eaaf0b1 (diff)
Merge tag 'for-linus-20181102' of git://git.kernel.dk/linux-block
Pull block layer fixes from Jens Axboe: "The biggest part of this pull request is the revert of the blkcg cleanup series. It had one fix earlier for a stacked device issue, but another one was reported. Rather than play whack-a-mole with this, revert the entire series and try again for the next kernel release. Apart from that, only small fixes/changes. Summary: - Indentation fixup for mtip32xx (Colin Ian King) - The blkcg cleanup series revert (Dennis Zhou) - Two NVMe fixes. One fixing a regression in the nvme request initialization in this merge window, causing nvme-fc to not work. The other is a suspend/resume p2p resource issue (James, Keith) - Fix sg discard merge, allowing us to merge in cases where we didn't before (Jianchao Wang) - Call rq_qos_exit() after the queue is frozen, preventing a hang (Ming) - Fix brd queue setup, fixing an oops if we fail setting up all devices (Ming)" * tag 'for-linus-20181102' of git://git.kernel.dk/linux-block: nvme-pci: fix conflicting p2p resource adds nvme-fc: fix request private initialization blkcg: revert blkcg cleanups series block: brd: associate with queue until adding disk block: call rq_qos_exit() after queue is frozen mtip32xx: clean an indentation issue, remove extraneous tabs block: fix the DISCARD request merge
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup/cgroup.c48
-rw-r--r--kernel/trace/blktrace.c4
2 files changed, 11 insertions, 41 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 8b79318810ad..6aaf5dd5383b 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -493,7 +493,7 @@ static struct cgroup_subsys_state *cgroup_tryget_css(struct cgroup *cgrp,
493} 493}
494 494
495/** 495/**
496 * cgroup_e_css_by_mask - obtain a cgroup's effective css for the specified ss 496 * cgroup_e_css - obtain a cgroup's effective css for the specified subsystem
497 * @cgrp: the cgroup of interest 497 * @cgrp: the cgroup of interest
498 * @ss: the subsystem of interest (%NULL returns @cgrp->self) 498 * @ss: the subsystem of interest (%NULL returns @cgrp->self)
499 * 499 *
@@ -502,8 +502,8 @@ static struct cgroup_subsys_state *cgroup_tryget_css(struct cgroup *cgrp,
502 * enabled. If @ss is associated with the hierarchy @cgrp is on, this 502 * enabled. If @ss is associated with the hierarchy @cgrp is on, this
503 * function is guaranteed to return non-NULL css. 503 * function is guaranteed to return non-NULL css.
504 */ 504 */
505static struct cgroup_subsys_state *cgroup_e_css_by_mask(struct cgroup *cgrp, 505static struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgrp,
506 struct cgroup_subsys *ss) 506 struct cgroup_subsys *ss)
507{ 507{
508 lockdep_assert_held(&cgroup_mutex); 508 lockdep_assert_held(&cgroup_mutex);
509 509
@@ -524,35 +524,6 @@ static struct cgroup_subsys_state *cgroup_e_css_by_mask(struct cgroup *cgrp,
524} 524}
525 525
526/** 526/**
527 * cgroup_e_css - obtain a cgroup's effective css for the specified subsystem
528 * @cgrp: the cgroup of interest
529 * @ss: the subsystem of interest
530 *
531 * Find and get the effective css of @cgrp for @ss. The effective css is
532 * defined as the matching css of the nearest ancestor including self which
533 * has @ss enabled. If @ss is not mounted on the hierarchy @cgrp is on,
534 * the root css is returned, so this function always returns a valid css.
535 *
536 * The returned css is not guaranteed to be online, and therefore it is the
537 * callers responsiblity to tryget a reference for it.
538 */
539struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgrp,
540 struct cgroup_subsys *ss)
541{
542 struct cgroup_subsys_state *css;
543
544 do {
545 css = cgroup_css(cgrp, ss);
546
547 if (css)
548 return css;
549 cgrp = cgroup_parent(cgrp);
550 } while (cgrp);
551
552 return init_css_set.subsys[ss->id];
553}
554
555/**
556 * cgroup_get_e_css - get a cgroup's effective css for the specified subsystem 527 * cgroup_get_e_css - get a cgroup's effective css for the specified subsystem
557 * @cgrp: the cgroup of interest 528 * @cgrp: the cgroup of interest
558 * @ss: the subsystem of interest 529 * @ss: the subsystem of interest
@@ -634,11 +605,10 @@ EXPORT_SYMBOL_GPL(of_css);
634 * 605 *
635 * Should be called under cgroup_[tree_]mutex. 606 * Should be called under cgroup_[tree_]mutex.
636 */ 607 */
637#define for_each_e_css(css, ssid, cgrp) \ 608#define for_each_e_css(css, ssid, cgrp) \
638 for ((ssid) = 0; (ssid) < CGROUP_SUBSYS_COUNT; (ssid)++) \ 609 for ((ssid) = 0; (ssid) < CGROUP_SUBSYS_COUNT; (ssid)++) \
639 if (!((css) = cgroup_e_css_by_mask(cgrp, \ 610 if (!((css) = cgroup_e_css(cgrp, cgroup_subsys[(ssid)]))) \
640 cgroup_subsys[(ssid)]))) \ 611 ; \
641 ; \
642 else 612 else
643 613
644/** 614/**
@@ -1037,7 +1007,7 @@ static struct css_set *find_existing_css_set(struct css_set *old_cset,
1037 * @ss is in this hierarchy, so we want the 1007 * @ss is in this hierarchy, so we want the
1038 * effective css from @cgrp. 1008 * effective css from @cgrp.
1039 */ 1009 */
1040 template[i] = cgroup_e_css_by_mask(cgrp, ss); 1010 template[i] = cgroup_e_css(cgrp, ss);
1041 } else { 1011 } else {
1042 /* 1012 /*
1043 * @ss is not in this hierarchy, so we don't want 1013 * @ss is not in this hierarchy, so we don't want
@@ -3054,7 +3024,7 @@ static int cgroup_apply_control(struct cgroup *cgrp)
3054 return ret; 3024 return ret;
3055 3025
3056 /* 3026 /*
3057 * At this point, cgroup_e_css_by_mask() results reflect the new csses 3027 * At this point, cgroup_e_css() results reflect the new csses
3058 * making the following cgroup_update_dfl_csses() properly update 3028 * making the following cgroup_update_dfl_csses() properly update
3059 * css associations of all tasks in the subtree. 3029 * css associations of all tasks in the subtree.
3060 */ 3030 */
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index fac0ddf8a8e2..2868d85f1fb1 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -764,9 +764,9 @@ blk_trace_bio_get_cgid(struct request_queue *q, struct bio *bio)
764 if (!bt || !(blk_tracer_flags.val & TRACE_BLK_OPT_CGROUP)) 764 if (!bt || !(blk_tracer_flags.val & TRACE_BLK_OPT_CGROUP))
765 return NULL; 765 return NULL;
766 766
767 if (!bio->bi_blkg) 767 if (!bio->bi_css)
768 return NULL; 768 return NULL;
769 return cgroup_get_kernfs_id(bio_blkcg(bio)->css.cgroup); 769 return cgroup_get_kernfs_id(bio->bi_css->cgroup);
770} 770}
771#else 771#else
772static union kernfs_node_id * 772static union kernfs_node_id *