Merge tag 'LA.UM.9.12.r1-18100-SMxx50.QSSI14.0' of https://git.codelinaro.org/clo/la/kernel/msm-4.19 into android13-4.19-kona
"LA.UM.9.12.r1-18100-SMxx50.QSSI14.0" * tag 'LA.UM.9.12.r1-18100-SMxx50.QSSI14.0' of https://git.codelinaro.org/clo/la/kernel/msm-4.19: msm: kgsl: Do not release dma and anon buffers if unmap fails mmc: sdhci-msm: Reset GCC_SDCC_BCR register for SDHC usb: phy: Enable clock before accessing EUD register space loop: Select I/O scheduler 'none' from inside add_disk() BACKPORT: loop: Fix missing discard support when using LOOP_CONFIGURE UPSTREAM: loop: unset GENHD_FL_NO_PART_SCAN on LOOP_CONFIGURE loop: Check for overflow while configuring loop BACKPORT: loop: Set correct device size when using LOOP_CONFIGURE cnss2: Add support for configuring calibration duration block: delete part_round_stats and switch to less precise counting BACKPORT: media: venus: hfi_parser: Add check for number of codecs BACKPORT: media: venus: hfi: add checks in capabilities from firmware BACKPORT: media: venus: hfi: fix the check in session buffer requirement BACKPORT: media: venus: hfi: add checks to perform sanity on queue pointers vidc_3x: venc: Add missing level in h263 msm: kgsl: Do not free sharedmem if it cannot be unmapped vidc_3x: Return EBUSY if mbpf check fails soc: qcom: qmi_encdec: out of bound check for input buffer Conflicts: drivers/media/platform/qcom/venus/hfi_parser.c drivers/media/platform/qcom/venus/hfi_venus.c Change-Id: I79781403e7d2e6417196eda9f67015c998d1e8d4
This commit is contained in:
33
block/bio.c
33
block/bio.c
@@ -1672,13 +1672,33 @@ void bio_check_pages_dirty(struct bio *bio)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bio_check_pages_dirty);
|
||||
|
||||
void update_io_ticks(struct hd_struct *part, unsigned long now)
|
||||
{
|
||||
unsigned long stamp;
|
||||
int cpu;
|
||||
again:
|
||||
stamp = READ_ONCE(part->stamp);
|
||||
if (unlikely(stamp != now)) {
|
||||
if (likely(cmpxchg(&part->stamp, stamp, now) == stamp)) {
|
||||
cpu = part_stat_lock();
|
||||
__part_stat_add(cpu, part, io_ticks, 1);
|
||||
part_stat_unlock();
|
||||
}
|
||||
}
|
||||
if (part->partno) {
|
||||
part = &part_to_disk(part)->part0;
|
||||
goto again;
|
||||
}
|
||||
}
|
||||
|
||||
void generic_start_io_acct(struct request_queue *q, int op,
|
||||
unsigned long sectors, struct hd_struct *part)
|
||||
{
|
||||
const int sgrp = op_stat_group(op);
|
||||
int cpu = part_stat_lock();
|
||||
int cpu;
|
||||
|
||||
part_round_stats(q, cpu, part);
|
||||
cpu = part_stat_lock();
|
||||
update_io_ticks(part, jiffies);
|
||||
part_stat_inc(cpu, part, ios[sgrp]);
|
||||
part_stat_add(cpu, part, sectors[sgrp], sectors);
|
||||
part_inc_in_flight(q, part, op_is_write(op));
|
||||
@@ -1690,12 +1710,15 @@ EXPORT_SYMBOL(generic_start_io_acct);
|
||||
void generic_end_io_acct(struct request_queue *q, int req_op,
|
||||
struct hd_struct *part, unsigned long start_time)
|
||||
{
|
||||
unsigned long duration = jiffies - start_time;
|
||||
unsigned long now = jiffies;
|
||||
unsigned long duration = now - start_time;
|
||||
const int sgrp = op_stat_group(req_op);
|
||||
int cpu = part_stat_lock();
|
||||
int cpu;
|
||||
|
||||
cpu = part_stat_lock();
|
||||
update_io_ticks(part, now);
|
||||
part_stat_add(cpu, part, nsecs[sgrp], jiffies_to_nsecs(duration));
|
||||
part_round_stats(q, cpu, part);
|
||||
part_stat_add(cpu, part, time_in_queue, duration);
|
||||
part_dec_in_flight(q, part, op_is_write(req_op));
|
||||
|
||||
part_stat_unlock();
|
||||
|
||||
@@ -1681,63 +1681,6 @@ static void add_acct_request(struct request_queue *q, struct request *rq,
|
||||
__elv_add_request(q, rq, where);
|
||||
}
|
||||
|
||||
static void part_round_stats_single(struct request_queue *q, int cpu,
|
||||
struct hd_struct *part, unsigned long now,
|
||||
unsigned int inflight)
|
||||
{
|
||||
if (inflight) {
|
||||
__part_stat_add(cpu, part, time_in_queue,
|
||||
inflight * (now - part->stamp));
|
||||
__part_stat_add(cpu, part, io_ticks, (now - part->stamp));
|
||||
}
|
||||
part->stamp = now;
|
||||
}
|
||||
|
||||
/**
|
||||
* part_round_stats() - Round off the performance stats on a struct disk_stats.
|
||||
* @q: target block queue
|
||||
* @cpu: cpu number for stats access
|
||||
* @part: target partition
|
||||
*
|
||||
* The average IO queue length and utilisation statistics are maintained
|
||||
* by observing the current state of the queue length and the amount of
|
||||
* time it has been in this state for.
|
||||
*
|
||||
* Normally, that accounting is done on IO completion, but that can result
|
||||
* in more than a second's worth of IO being accounted for within any one
|
||||
* second, leading to >100% utilisation. To deal with that, we call this
|
||||
* function to do a round-off before returning the results when reading
|
||||
* /proc/diskstats. This accounts immediately for all queue usage up to
|
||||
* the current jiffies and restarts the counters again.
|
||||
*/
|
||||
void part_round_stats(struct request_queue *q, int cpu, struct hd_struct *part)
|
||||
{
|
||||
struct hd_struct *part2 = NULL;
|
||||
unsigned long now = jiffies;
|
||||
unsigned int inflight[2];
|
||||
int stats = 0;
|
||||
|
||||
if (part->stamp != now)
|
||||
stats |= 1;
|
||||
|
||||
if (part->partno) {
|
||||
part2 = &part_to_disk(part)->part0;
|
||||
if (part2->stamp != now)
|
||||
stats |= 2;
|
||||
}
|
||||
|
||||
if (!stats)
|
||||
return;
|
||||
|
||||
part_in_flight(q, part, inflight);
|
||||
|
||||
if (stats & 2)
|
||||
part_round_stats_single(q, cpu, part2, now, inflight[1]);
|
||||
if (stats & 1)
|
||||
part_round_stats_single(q, cpu, part, now, inflight[0]);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(part_round_stats);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void blk_pm_put_request(struct request *rq)
|
||||
{
|
||||
@@ -2775,9 +2718,10 @@ void blk_account_io_done(struct request *req, u64 now)
|
||||
cpu = part_stat_lock();
|
||||
part = req->part;
|
||||
|
||||
update_io_ticks(part, jiffies);
|
||||
part_stat_inc(cpu, part, ios[sgrp]);
|
||||
part_stat_add(cpu, part, nsecs[sgrp], now - req->start_time_ns);
|
||||
part_round_stats(req->q, cpu, part);
|
||||
part_stat_add(cpu, part, time_in_queue, nsecs_to_jiffies64(now - req->start_time_ns));
|
||||
part_dec_in_flight(req->q, part, rq_data_dir(req));
|
||||
|
||||
hd_struct_put(part);
|
||||
@@ -2837,11 +2781,12 @@ void blk_account_io_start(struct request *rq, bool new_io)
|
||||
part = &rq->rq_disk->part0;
|
||||
hd_struct_get(part);
|
||||
}
|
||||
part_round_stats(rq->q, cpu, part);
|
||||
part_inc_in_flight(rq->q, part, rw);
|
||||
rq->part = part;
|
||||
}
|
||||
|
||||
update_io_ticks(part, jiffies);
|
||||
|
||||
part_stat_unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -673,7 +673,6 @@ static void blk_account_io_merge(struct request *req)
|
||||
cpu = part_stat_lock();
|
||||
part = req->part;
|
||||
|
||||
part_round_stats(req->q, cpu, part);
|
||||
part_dec_in_flight(req->q, part, rq_data_dir(req));
|
||||
|
||||
hd_struct_put(part);
|
||||
|
||||
@@ -1339,7 +1339,6 @@ static int diskstats_show(struct seq_file *seqf, void *v)
|
||||
struct hd_struct *hd;
|
||||
char buf[BDEVNAME_SIZE];
|
||||
unsigned int inflight[2];
|
||||
int cpu;
|
||||
|
||||
/*
|
||||
if (&disk_to_dev(gp)->kobj.entry == block_class.devices.next)
|
||||
@@ -1351,9 +1350,6 @@ static int diskstats_show(struct seq_file *seqf, void *v)
|
||||
|
||||
disk_part_iter_init(&piter, gp, DISK_PITER_INCL_EMPTY_PART0);
|
||||
while ((hd = disk_part_iter_next(&piter))) {
|
||||
cpu = part_stat_lock();
|
||||
part_round_stats(gp->queue, cpu, hd);
|
||||
part_stat_unlock();
|
||||
part_in_flight(gp->queue, hd, inflight);
|
||||
seq_printf(seqf, "%4d %7d %s "
|
||||
"%lu %lu %lu %u "
|
||||
|
||||
@@ -121,11 +121,7 @@ ssize_t part_stat_show(struct device *dev,
|
||||
struct hd_struct *p = dev_to_part(dev);
|
||||
struct request_queue *q = part_to_disk(p)->queue;
|
||||
unsigned int inflight[2];
|
||||
int cpu;
|
||||
|
||||
cpu = part_stat_lock();
|
||||
part_round_stats(q, cpu, p);
|
||||
part_stat_unlock();
|
||||
part_in_flight(q, p, inflight);
|
||||
return sprintf(buf,
|
||||
"%8lu %8lu %8llu %8u "
|
||||
|
||||
Reference in New Issue
Block a user