Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c4b4c2a
buffer: remove useless comment and WB_REASON_FREE_MORE_MEM, reason.
ZhiqiangLiu26 Apr 13, 2020
44575a6
io_uring: only restore req->work for req that needs do completion
Apr 19, 2020
1c5e1cd
ACPI/PCI: pci_link: use extended_irq union member when setting ext-ir…
jwrdegoede Apr 13, 2020
2c9a583
pm-graph v5.6
tebrandt Apr 8, 2020
2b6022a
ACPI: button: Drop no longer necessary Asus T200TA lid_init_state quirk
jwrdegoede Apr 19, 2020
b849dd8
bdev: Reduce time holding bd_mutex in sync in blkdev_close()
dianders Mar 24, 2020
d6c8e94
blk-iocost: Fix error on iocost_ioc_vrate_adj
Waiman-Long Apr 21, 2020
d56deb1
block: remove unused header
majianpeng Apr 21, 2020
01b2baf
pnp: Use list_for_each_entry() instead of open coding
jgunthorpe Apr 14, 2020
09beebd
PM: sleep: core: Switch back to async_schedule_dev()
khfeng Apr 21, 2020
9da7397
tracing: Fix memory leaks in trace_events_hist.c
Apr 22, 2020
353da87
ftrace: Fix memory leak caused by not freeing entry in unregister_ftr…
rostedt Apr 23, 2020
a2806ef
tracing: Remove DECLARE_TRACE_NOARGS
lorddoskias Apr 13, 2020
d013496
tracing: Convert local functions in tracing_map.c to static
JasonYanHw Apr 10, 2020
9dd44c7
null_blk: Fix zoned command handling
damien-lemoal Apr 23, 2020
d205bde
null_blk: Cleanup zoned device initialization
damien-lemoal Apr 23, 2020
89e7c85
ata: sata_inic162x fix a spelling issue
Apr 23, 2020
4bee16d
Merge branch 'pm-tools'
rafaeljw Apr 24, 2020
0db0d14
Merge branch 'acpi-pci'
rafaeljw Apr 24, 2020
da5de55
Merge tag 'trace-v5.7-rc2' of git://git.kernel.org/pub/scm/linux/kern…
torvalds Apr 24, 2020
3d29cb1
Merge tag 'block-5.7-2020-04-24' of git://git.kernel.dk/linux-block
torvalds Apr 24, 2020
81da3d3
Merge tag 'libata-5.7-2020-04-24' of git://git.kernel.dk/linux-block
torvalds Apr 24, 2020
aee1a00
Merge tag 'io_uring-5.7-2020-04-24' of git://git.kernel.dk/linux-block
torvalds Apr 24, 2020
bc0c4d1
mm: check that mm is still valid in madvise()
torvalds Apr 24, 2020
9dc5d98
Merge tag 'acpi-5.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel…
torvalds Apr 24, 2020
5be35f7
Merge tag 'pnp-5.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/…
torvalds Apr 24, 2020
8e9ccd0
Merge tag 'pm-5.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/g…
torvalds Apr 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions block/blk-iocost.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ static void ioc_timer_fn(struct timer_list *timer)
vrate_min, vrate_max);
}

trace_iocost_ioc_vrate_adj(ioc, vrate, &missed_ppm, rq_wait_pct,
trace_iocost_ioc_vrate_adj(ioc, vrate, missed_ppm, rq_wait_pct,
nr_lagging, nr_shortages,
nr_surpluses);

Expand All @@ -1600,7 +1600,7 @@ static void ioc_timer_fn(struct timer_list *timer)
ioc->period_us * vrate * INUSE_MARGIN_PCT, 100);
} else if (ioc->busy_level != prev_busy_level || nr_lagging) {
trace_iocost_ioc_vrate_adj(ioc, atomic64_read(&ioc->vtime_rate),
&missed_ppm, rq_wait_pct, nr_lagging,
missed_ppm, rq_wait_pct, nr_lagging,
nr_shortages, nr_surpluses);
}

Expand Down
12 changes: 0 additions & 12 deletions drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,6 @@ static const struct dmi_system_id dmi_lid_quirks[] = {
},
.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_DISABLED,
},
{
/*
* Asus T200TA, _LID keeps reporting closed after every second
* openening of the lid. Causing immediate re-suspend after
* opening every other open. Using LID_INIT_OPEN fixes this.
*/
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "T200TA"),
},
.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
},
{
/* GP-electronic T701, _LID method points to a floating GPIO */
.matches = {
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/pci_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
resource->res.data.extended_irq.polarity =
link->irq.polarity;
if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
resource->res.data.irq.shareable =
resource->res.data.extended_irq.shareable =
ACPI_EXCLUSIVE;
else
resource->res.data.irq.shareable = ACPI_SHARED;
resource->res.data.extended_irq.shareable = ACPI_SHARED;
resource->res.data.extended_irq.interrupt_count = 1;
resource->res.data.extended_irq.interrupts[0] = irq;
/* ignore resource_source, it's optional */
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/sata_inic162x.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ enum {

/* PORT_IDMA_CTL bits */
IDMA_CTL_RST_ATA = (1 << 2), /* hardreset ATA bus */
IDMA_CTL_RST_IDMA = (1 << 5), /* reset IDMA machinary */
IDMA_CTL_RST_IDMA = (1 << 5), /* reset IDMA machinery */
IDMA_CTL_GO = (1 << 7), /* IDMA mode go */
IDMA_CTL_ATA_NIEN = (1 << 8), /* ATA IRQ disable */

Expand Down
2 changes: 1 addition & 1 deletion drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ static bool dpm_async_fn(struct device *dev, async_func_t func)

if (is_async(dev)) {
get_device(dev);
async_schedule(func, dev);
async_schedule_dev(func, dev);
return true;
}

Expand Down
29 changes: 19 additions & 10 deletions drivers/block/null_blk.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,35 @@ struct nullb {
char disk_name[DISK_NAME_LEN];
};

blk_status_t null_process_cmd(struct nullb_cmd *cmd,
enum req_opf op, sector_t sector,
unsigned int nr_sectors);

#ifdef CONFIG_BLK_DEV_ZONED
int null_zone_init(struct nullb_device *dev);
void null_zone_exit(struct nullb_device *dev);
int null_init_zoned_dev(struct nullb_device *dev, struct request_queue *q);
int null_register_zoned_dev(struct nullb *nullb);
void null_free_zoned_dev(struct nullb_device *dev);
int null_report_zones(struct gendisk *disk, sector_t sector,
unsigned int nr_zones, report_zones_cb cb, void *data);
blk_status_t null_handle_zoned(struct nullb_cmd *cmd,
enum req_opf op, sector_t sector,
sector_t nr_sectors);
blk_status_t null_process_zoned_cmd(struct nullb_cmd *cmd,
enum req_opf op, sector_t sector,
sector_t nr_sectors);
size_t null_zone_valid_read_len(struct nullb *nullb,
sector_t sector, unsigned int len);
#else
static inline int null_zone_init(struct nullb_device *dev)
static inline int null_init_zoned_dev(struct nullb_device *dev,
struct request_queue *q)
{
pr_err("CONFIG_BLK_DEV_ZONED not enabled\n");
return -EINVAL;
}
static inline void null_zone_exit(struct nullb_device *dev) {}
static inline blk_status_t null_handle_zoned(struct nullb_cmd *cmd,
enum req_opf op, sector_t sector,
sector_t nr_sectors)
static inline int null_register_zoned_dev(struct nullb *nullb)
{
return -ENODEV;
}
static inline void null_free_zoned_dev(struct nullb_device *dev) {}
static inline blk_status_t null_process_zoned_cmd(struct nullb_cmd *cmd,
enum req_opf op, sector_t sector, sector_t nr_sectors)
{
return BLK_STS_NOTSUPP;
}
Expand Down
62 changes: 31 additions & 31 deletions drivers/block/null_blk_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ static void null_free_dev(struct nullb_device *dev)
if (!dev)
return;

null_zone_exit(dev);
null_free_zoned_dev(dev);
badblocks_exit(&dev->badblocks);
kfree(dev);
}
Expand Down Expand Up @@ -1276,6 +1276,25 @@ static inline void nullb_complete_cmd(struct nullb_cmd *cmd)
}
}

blk_status_t null_process_cmd(struct nullb_cmd *cmd,
enum req_opf op, sector_t sector,
unsigned int nr_sectors)
{
struct nullb_device *dev = cmd->nq->dev;
blk_status_t ret;

if (dev->badblocks.shift != -1) {
ret = null_handle_badblocks(cmd, sector, nr_sectors);
if (ret != BLK_STS_OK)
return ret;
}

if (dev->memory_backed)
return null_handle_memory_backed(cmd, op);

return BLK_STS_OK;
}

static blk_status_t null_handle_cmd(struct nullb_cmd *cmd, sector_t sector,
sector_t nr_sectors, enum req_opf op)
{
Expand All @@ -1294,17 +1313,11 @@ static blk_status_t null_handle_cmd(struct nullb_cmd *cmd, sector_t sector,
goto out;
}

if (nullb->dev->badblocks.shift != -1) {
cmd->error = null_handle_badblocks(cmd, sector, nr_sectors);
if (cmd->error != BLK_STS_OK)
goto out;
}

if (dev->memory_backed)
cmd->error = null_handle_memory_backed(cmd, op);

if (!cmd->error && dev->zoned)
cmd->error = null_handle_zoned(cmd, op, sector, nr_sectors);
if (dev->zoned)
cmd->error = null_process_zoned_cmd(cmd, op,
sector, nr_sectors);
else
cmd->error = null_process_cmd(cmd, op, sector, nr_sectors);

out:
nullb_complete_cmd(cmd);
Expand Down Expand Up @@ -1605,19 +1618,12 @@ static int null_gendisk_register(struct nullb *nullb)
disk->queue = nullb->q;
strncpy(disk->disk_name, nullb->disk_name, DISK_NAME_LEN);

#ifdef CONFIG_BLK_DEV_ZONED
if (nullb->dev->zoned) {
if (queue_is_mq(nullb->q)) {
int ret = blk_revalidate_disk_zones(disk);
if (ret)
return ret;
} else {
blk_queue_chunk_sectors(nullb->q,
nullb->dev->zone_size_sects);
nullb->q->nr_zones = blkdev_nr_zones(disk);
}
int ret = null_register_zoned_dev(nullb);

if (ret)
return ret;
}
#endif

add_disk(disk);
return 0;
Expand Down Expand Up @@ -1773,14 +1779,9 @@ static int null_add_dev(struct nullb_device *dev)
}

if (dev->zoned) {
rv = null_zone_init(dev);
rv = null_init_zoned_dev(dev, nullb->q);
if (rv)
goto out_cleanup_blk_queue;

nullb->q->limits.zoned = BLK_ZONED_HM;
blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, nullb->q);
blk_queue_required_elevator_features(nullb->q,
ELEVATOR_F_ZBD_SEQ_WRITE);
}

nullb->q->queuedata = nullb;
Expand Down Expand Up @@ -1809,8 +1810,7 @@ static int null_add_dev(struct nullb_device *dev)

return 0;
out_cleanup_zone:
if (dev->zoned)
null_zone_exit(dev);
null_free_zoned_dev(dev);
out_cleanup_blk_queue:
blk_cleanup_queue(nullb->q);
out_cleanup_tags:
Expand Down
45 changes: 33 additions & 12 deletions drivers/block/null_blk_zoned.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static inline unsigned int null_zone_no(struct nullb_device *dev, sector_t sect)
return sect >> ilog2(dev->zone_size_sects);
}

int null_zone_init(struct nullb_device *dev)
int null_init_zoned_dev(struct nullb_device *dev, struct request_queue *q)
{
sector_t dev_size = (sector_t)dev->size * 1024 * 1024;
sector_t sector = 0;
Expand Down Expand Up @@ -61,10 +61,27 @@ int null_zone_init(struct nullb_device *dev)
sector += dev->zone_size_sects;
}

q->limits.zoned = BLK_ZONED_HM;
blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q);
blk_queue_required_elevator_features(q, ELEVATOR_F_ZBD_SEQ_WRITE);

return 0;
}

int null_register_zoned_dev(struct nullb *nullb)
{
struct request_queue *q = nullb->q;

if (queue_is_mq(q))
return blk_revalidate_disk_zones(nullb->disk);

blk_queue_chunk_sectors(q, nullb->dev->zone_size_sects);
q->nr_zones = blkdev_nr_zones(nullb->disk);

return 0;
}

void null_zone_exit(struct nullb_device *dev)
void null_free_zoned_dev(struct nullb_device *dev)
{
kvfree(dev->zones);
}
Expand Down Expand Up @@ -126,11 +143,16 @@ static blk_status_t null_zone_write(struct nullb_cmd *cmd, sector_t sector,
struct nullb_device *dev = cmd->nq->dev;
unsigned int zno = null_zone_no(dev, sector);
struct blk_zone *zone = &dev->zones[zno];
blk_status_t ret;

trace_nullb_zone_op(cmd, zno, zone->cond);

if (zone->type == BLK_ZONE_TYPE_CONVENTIONAL)
return null_process_cmd(cmd, REQ_OP_WRITE, sector, nr_sectors);

switch (zone->cond) {
case BLK_ZONE_COND_FULL:
/* Cannot write to a full zone */
cmd->error = BLK_STS_IOERR;
return BLK_STS_IOERR;
case BLK_ZONE_COND_EMPTY:
case BLK_ZONE_COND_IMP_OPEN:
Expand All @@ -143,19 +165,18 @@ static blk_status_t null_zone_write(struct nullb_cmd *cmd, sector_t sector,
if (zone->cond != BLK_ZONE_COND_EXP_OPEN)
zone->cond = BLK_ZONE_COND_IMP_OPEN;

ret = null_process_cmd(cmd, REQ_OP_WRITE, sector, nr_sectors);
if (ret != BLK_STS_OK)
return ret;

zone->wp += nr_sectors;
if (zone->wp == zone->start + zone->len)
zone->cond = BLK_ZONE_COND_FULL;
break;
case BLK_ZONE_COND_NOT_WP:
break;
return BLK_STS_OK;
default:
/* Invalid zone condition */
return BLK_STS_IOERR;
}

trace_nullb_zone_op(cmd, zno, zone->cond);
return BLK_STS_OK;
}

static blk_status_t null_zone_mgmt(struct nullb_cmd *cmd, enum req_opf op,
Expand Down Expand Up @@ -216,8 +237,8 @@ static blk_status_t null_zone_mgmt(struct nullb_cmd *cmd, enum req_opf op,
return BLK_STS_OK;
}

blk_status_t null_handle_zoned(struct nullb_cmd *cmd, enum req_opf op,
sector_t sector, sector_t nr_sectors)
blk_status_t null_process_zoned_cmd(struct nullb_cmd *cmd, enum req_opf op,
sector_t sector, sector_t nr_sectors)
{
switch (op) {
case REQ_OP_WRITE:
Expand All @@ -229,6 +250,6 @@ blk_status_t null_handle_zoned(struct nullb_cmd *cmd, enum req_opf op,
case REQ_OP_ZONE_FINISH:
return null_zone_mgmt(cmd, op, sector);
default:
return BLK_STS_OK;
return null_process_cmd(cmd, op, sector, nr_sectors);
}
}
11 changes: 10 additions & 1 deletion fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <linux/module.h>
#include <linux/blkpg.h>
#include <linux/magic.h>
#include <linux/dax.h>
#include <linux/buffer_head.h>
#include <linux/swap.h>
#include <linux/pagevec.h>
Expand Down Expand Up @@ -1893,6 +1892,16 @@ static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
struct gendisk *disk = bdev->bd_disk;
struct block_device *victim = NULL;

/*
* Sync early if it looks like we're the last one. If someone else
* opens the block device between now and the decrement of bd_openers
* then we did a sync that we didn't need to, but that's not the end
* of the world and we want to avoid long (could be several minute)
* syncs while holding the mutex.
*/
if (bdev->bd_openers == 1)
sync_blockdev(bdev);

mutex_lock_nested(&bdev->bd_mutex, for_part);
if (for_part)
bdev->bd_part_count--;
Expand Down
2 changes: 1 addition & 1 deletion fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ grow_dev_page(struct block_device *bdev, sector_t block,
struct page *page;
struct buffer_head *bh;
sector_t end_block;
int ret = 0; /* Will call free_more_memory() */
int ret = 0;
gfp_t gfp_mask;

gfp_mask = mapping_gfp_constraint(inode->i_mapping, ~__GFP_FS) | gfp;
Expand Down
10 changes: 5 additions & 5 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -4200,17 +4200,17 @@ static void io_async_task_func(struct callback_head *cb)

spin_unlock_irq(&ctx->completion_lock);

/* restore ->work in case we need to retry again */
memcpy(&req->work, &apoll->work, sizeof(req->work));

if (canceled) {
kfree(apoll);
io_cqring_ev_posted(ctx);
req_set_fail_links(req);
io_put_req(req);
io_double_put_req(req);
return;
}

/* restore ->work in case we need to retry again */
memcpy(&req->work, &apoll->work, sizeof(req->work));

__set_current_state(TASK_RUNNING);
mutex_lock(&ctx->uring_lock);
__io_queue_sqe(req, NULL);
Expand Down Expand Up @@ -4369,7 +4369,7 @@ static bool io_poll_remove_one(struct io_kiocb *req)

hash_del(&req->hash_node);

if (apoll) {
if (do_complete && apoll) {
/*
* restore ->work because we need to call io_req_work_drop_env.
*/
Expand Down
1 change: 0 additions & 1 deletion include/linux/backing-dev-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ enum wb_reason {
WB_REASON_SYNC,
WB_REASON_PERIODIC,
WB_REASON_LAPTOP_TIMER,
WB_REASON_FREE_MORE_MEM,
WB_REASON_FS_FREE_SPACE,
/*
* There is no bdi forker thread any more and works are done
Expand Down
Loading