Re: rename ->make_request_fn and move it to the block_device_operations v2
On 7/1/20 2:59 AM, Christoph Hellwig wrote: > Hi Jens, > > this series moves the make_request_fn method into block_device_operations > with the much more descriptive ->submit_bio name. It then also gives > generic_make_request a more descriptive name, and further optimize the > path to issue to blk-mq, removing the need for the direct_make_request > bypass. Thanks, I'll try this again. -- Jens Axboe
rename ->make_request_fn and move it to the block_device_operations v2
Hi Jens, this series moves the make_request_fn method into block_device_operations with the much more descriptive ->submit_bio name. It then also gives generic_make_request a more descriptive name, and further optimize the path to issue to blk-mq, removing the need for the direct_make_request bypass. Changes since v1: - fix a null pointer dereference when dispatching from bio to request based drivers - clean up a few more comments Diffstat: Documentation/block/biodoc.rst|2 Documentation/block/writeback_cache_control.rst |2 Documentation/fault-injection/fault-injection.rst |2 Documentation/trace/ftrace.rst|4 arch/m68k/emu/nfblock.c |8 arch/xtensa/platforms/iss/simdisk.c |9 block/bio.c | 14 - block/blk-cgroup.c|2 block/blk-core.c | 255 +- block/blk-crypto-fallback.c |2 block/blk-crypto.c|2 block/blk-merge.c | 23 - block/blk-mq.c| 12 - block/blk-throttle.c |4 block/blk.h |5 block/bounce.c|2 drivers/block/brd.c |5 drivers/block/drbd/drbd_int.h |8 drivers/block/drbd/drbd_main.c| 12 - drivers/block/drbd/drbd_receiver.c|2 drivers/block/drbd/drbd_req.c |8 drivers/block/drbd/drbd_worker.c |2 drivers/block/null_blk_main.c | 19 + drivers/block/pktcdvd.c | 15 - drivers/block/ps3vram.c | 20 - drivers/block/rsxx/dev.c | 14 - drivers/block/umem.c | 11 drivers/block/zram/zram_drv.c | 14 - drivers/lightnvm/core.c |8 drivers/lightnvm/pblk-init.c | 16 - drivers/lightnvm/pblk-read.c |2 drivers/md/bcache/bcache.h|2 drivers/md/bcache/btree.c |2 drivers/md/bcache/request.c | 11 drivers/md/bcache/request.h |4 drivers/md/bcache/super.c | 24 +- drivers/md/dm-cache-target.c |6 drivers/md/dm-clone-target.c | 10 drivers/md/dm-crypt.c |6 drivers/md/dm-delay.c |2 drivers/md/dm-era-target.c|2 drivers/md/dm-integrity.c |4 drivers/md/dm-mpath.c |2 drivers/md/dm-raid1.c |2 drivers/md/dm-snap-persistent.c |2 drivers/md/dm-snap.c |6 drivers/md/dm-thin.c |4 drivers/md/dm-verity-target.c |2 drivers/md/dm-writecache.c|2 drivers/md/dm-zoned-target.c |2 drivers/md/dm.c | 41 +-- drivers/md/md-faulty.c|4 drivers/md/md-linear.c|4 drivers/md/md-multipath.c |4 drivers/md/md.c |7 drivers/md/raid0.c|8 drivers/md/raid1.c| 14 - drivers/md/raid10.c | 28 +- drivers/md/raid5.c| 10 drivers/nvdimm/blk.c |5 drivers/nvdimm/btt.c |5 drivers/nvdimm/pmem.c |5 drivers/nvme/host/core.c |1 drivers/nvme/host/multipath.c | 18 - drivers/nvme/host/nvme.h |1 drivers/s390/block/dcssblk.c | 11 drivers/s390/block/xpram.c|8 fs/buffer.c |5 include/linux/blk-mq.h|2 include/linux/blkdev.h| 12 - include/linux/lightnvm.h |3 71 files changed, 387 insertions(+), 408 deletions(-)
Re: rename ->make_request_fn and move it to the block_device_operations
On 6/30/20 12:21 PM, Jens Axboe wrote: > On 6/30/20 12:19 PM, Christoph Hellwig wrote: >> On Tue, Jun 30, 2020 at 09:43:31AM -0600, Jens Axboe wrote: >>> On 6/30/20 7:57 AM, Jens Axboe wrote: On 6/29/20 1:39 PM, Christoph Hellwig wrote: > Hi Jens, > > this series moves the make_request_fn method into block_device_operations > with the much more descriptive ->submit_bio name. It then also gives > generic_make_request a more descriptive name, and further optimize the > path to issue to blk-mq, removing the need for the direct_make_request > bypass. Looks good to me, and it's a nice cleanup as well. Applied. >>> >>> Dropped, insta-crashes with dm: >> >> Hmm. Can you send me what is at "submit_bio_noacct+0x1f6" from gdb? >> Or your .config? > > I'd have to apply and compile again. But it's a bad RIP, so I'm guessing > it's ->submit_bio == NULL. Let me know if you really need it, and I can > re-generate the OOPS and have the vmlinux too. Here's the .config -- Jens Axboe # # Automatically generated file; DO NOT EDIT. # Linux/x86 5.8.0-rc1 Kernel Configuration # CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 10.1.0-2ubuntu1~18.04) 10.1.0" CONFIG_CC_IS_GCC=y CONFIG_GCC_VERSION=100100 CONFIG_LD_VERSION=23000 CONFIG_CLANG_VERSION=0 CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK_STATIC=y CONFIG_CC_HAS_ASM_GOTO=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_BUILD_SALT="" CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y CONFIG_KERNEL_GZIP=y # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_LZMA is not set # CONFIG_KERNEL_XZ is not set # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_INIT="" CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE_SYSCTL=y # CONFIG_WATCH_QUEUE is not set CONFIG_CROSS_MEMORY_ATTACH=y # CONFIG_USELIB is not set # CONFIG_AUDIT is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_GENERIC_IRQ_MIGRATION=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y CONFIG_GENERIC_IRQ_RESERVATION_MODE=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y # CONFIG_GENERIC_IRQ_DEBUGFS is not set # end of IRQ subsystem CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_INIT=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y # CONFIG_NO_HZ_FULL is not set # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y # end of Timers subsystem # CONFIG_PREEMPT_NONE is not set # CONFIG_PREEMPT_VOLUNTARY is not set CONFIG_PREEMPT=y CONFIG_PREEMPT_COUNT=y CONFIG_PREEMPTION=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set # CONFIG_IRQ_TIME_ACCOUNTING is not set # CONFIG_SCHED_THERMAL_PRESSURE is not set CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y CONFIG_TASK_XACCT=y CONFIG_TASK_IO_ACCOUNTING=y # CONFIG_PSI is not set # end of CPU/Task time and stats accounting # CONFIG_CPU_ISOLATION is not set # # RCU Subsystem # CONFIG_TREE_RCU=y CONFIG_PREEMPT_RCU=y # CONFIG_RCU_EXPERT is not set CONFIG_SRCU=y CONFIG_TREE_SRCU=y CONFIG_TASKS_RCU_GENERIC=y CONFIG_TASKS_RCU=y CONFIG_TASKS_RUDE_RCU=y CONFIG_RCU_STALL_COMMON=y CONFIG_RCU_NEED_SEGCBLIST=y # end of RCU Subsystem CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_IKHEADERS is not set CONFIG_LOG_BUF_SHIFT=18 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y # # Scheduler features # # CONFIG_UCLAMP_TASK is not set # end of Scheduler features CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_CC_HAS_INT128=y CONFIG_ARCH_SUPPORTS_INT128=y CONFIG_NUMA_BALANCING=y CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y CONFIG_CGROUPS=y # CONFIG_MEMCG is not set CONFIG_BLK_CGROUP=y CONFIG_CGROUP_SCHED=y CONFIG_FAIR_GROUP_SCHED=y # CONFIG_CFS_BANDWIDTH is not set # CONFIG_RT_GROUP_SCHED is not set # CONFIG_CGROUP_PIDS is not set # CONFIG_CGROUP_RDMA is not set # CONFIG_CGROUP_FREEZER is not set # CONFIG_CGROUP_HUGETLB is not set # CONFIG_CPUSETS is not set # CONFIG_CGROUP_DEVICE is not set # CONFIG_CGROUP_CPUACCT
Re: rename ->make_request_fn and move it to the block_device_operations
On 6/30/20 12:19 PM, Christoph Hellwig wrote: > On Tue, Jun 30, 2020 at 09:43:31AM -0600, Jens Axboe wrote: >> On 6/30/20 7:57 AM, Jens Axboe wrote: >>> On 6/29/20 1:39 PM, Christoph Hellwig wrote: Hi Jens, this series moves the make_request_fn method into block_device_operations with the much more descriptive ->submit_bio name. It then also gives generic_make_request a more descriptive name, and further optimize the path to issue to blk-mq, removing the need for the direct_make_request bypass. >>> >>> Looks good to me, and it's a nice cleanup as well. Applied. >> >> Dropped, insta-crashes with dm: > > Hmm. Can you send me what is at "submit_bio_noacct+0x1f6" from gdb? > Or your .config? I'd have to apply and compile again. But it's a bad RIP, so I'm guessing it's ->submit_bio == NULL. Let me know if you really need it, and I can re-generate the OOPS and have the vmlinux too. -- Jens Axboe
Re: rename ->make_request_fn and move it to the block_device_operations
On Tue, Jun 30, 2020 at 09:43:31AM -0600, Jens Axboe wrote: > On 6/30/20 7:57 AM, Jens Axboe wrote: > > On 6/29/20 1:39 PM, Christoph Hellwig wrote: > >> Hi Jens, > >> > >> this series moves the make_request_fn method into block_device_operations > >> with the much more descriptive ->submit_bio name. It then also gives > >> generic_make_request a more descriptive name, and further optimize the > >> path to issue to blk-mq, removing the need for the direct_make_request > >> bypass. > > > > Looks good to me, and it's a nice cleanup as well. Applied. > > Dropped, insta-crashes with dm: Hmm. Can you send me what is at "submit_bio_noacct+0x1f6" from gdb? Or your .config?
Re: rename ->make_request_fn and move it to the block_device_operations
On 6/30/20 7:57 AM, Jens Axboe wrote: > On 6/29/20 1:39 PM, Christoph Hellwig wrote: >> Hi Jens, >> >> this series moves the make_request_fn method into block_device_operations >> with the much more descriptive ->submit_bio name. It then also gives >> generic_make_request a more descriptive name, and further optimize the >> path to issue to blk-mq, removing the need for the direct_make_request >> bypass. > > Looks good to me, and it's a nice cleanup as well. Applied. Dropped, insta-crashes with dm: [ 10.240134] BUG: kernel NULL pointer dereference, address: [ 10.241000] #PF: supervisor instruction fetch in kernel mode [ 10.241666] #PF: error_code(0x0010) - not-present page [ 10.242280] PGD 0 P4D 0 [ 10.242600] Oops: 0010 [#1] PREEMPT SMP [ 10.243073] CPU: 1 PID: 2110 Comm: systemd-udevd Not tainted 5.8.0-rc3+ #6655 [ 10.243939] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1 04/01/2014 [ 10.245012] RIP: 0010:0x0 [ 10.245322] Code: Bad RIP value. [ 10.245695] RSP: 0018:c92f7af8 EFLAGS: 00010246 [ 10.246333] RAX: 81c83520 RBX: 8881b805dea8 RCX: 88819e844070 [ 10.247227] RDX: RSI: RDI: 88819e844070 [ 10.248112] RBP: c92f7b48 R08: 8881b6f38800 R09: 88818ff0ea58 [ 10.248994] R10: R11: 88818ff0ea58 R12: 88819e844070 [ 10.250077] R13: R14: R15: 888107812948 [ 10.251168] FS: 7f5c3ed66a80() GS:8881b9c8() knlGS: [ 10.252161] CS: 0010 DS: ES: CR0: 80050033 [ 10.253189] CR2: ffd6 CR3: 0001b2953003 CR4: 001606e0 [ 10.254157] DR0: DR1: DR2: [ 10.255279] DR3: DR6: fffe0ff0 DR7: 0400 [ 10.256365] Call Trace: [ 10.256781] submit_bio_noacct+0x1f6/0x3d0 [ 10.257297] submit_bio+0x37/0x130 [ 10.257780] ? guard_bio_eod+0x2e/0x70 [ 10.258418] mpage_readahead+0x13c/0x180 [ 10.259096] ? blkdev_direct_IO+0x490/0x490 [ 10.259654] read_pages+0x68/0x2d0 [ 10.260051] page_cache_readahead_unbounded+0x1b7/0x220 [ 10.260818] generic_file_buffered_read+0x865/0xc80 [ 10.261587] ? _copy_to_user+0x6d/0x80 [ 10.262171] ? cp_new_stat+0x119/0x130 [ 10.262680] new_sync_read+0xfe/0x170 [ 10.263155] vfs_read+0xc8/0x180 [ 10.263647] ksys_read+0x53/0xc0 [ 10.264209] do_syscall_64+0x3c/0x70 [ 10.264759] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 10.265200] RIP: 0033:0x7f5c3fcc9ab2 [ 10.265510] Code: Bad RIP value. [ 10.265775] RSP: 002b:7ffc8e0cf9c8 EFLAGS: 0246 ORIG_RAX: [ 10.266426] RAX: ffda RBX: 55d5eca76c68 RCX: 7f5c3fcc9ab2 [ 10.267012] RDX: 0040 RSI: 55d5eca76c78 RDI: 0006 [ 10.267591] RBP: 55d5eca44890 R08: 55d5eca76c50 R09: 7f5c3fd99a40 [ 10.268168] R10: 0008 R11: 0246 R12: 3bd9 [ 10.268744] R13: 0040 R14: 55d5eca76c50 R15: 55d5eca448e0 [ 10.269319] Modules linked in: [ 10.269562] CR2: [ 10.269845] ---[ end trace f09b8963e5a3593b ]--- -- Jens Axboe
Re: rename ->make_request_fn and move it to the block_device_operations
On 6/29/20 1:39 PM, Christoph Hellwig wrote: > Hi Jens, > > this series moves the make_request_fn method into block_device_operations > with the much more descriptive ->submit_bio name. It then also gives > generic_make_request a more descriptive name, and further optimize the > path to issue to blk-mq, removing the need for the direct_make_request > bypass. Looks good to me, and it's a nice cleanup as well. Applied. -- Jens Axboe
rename ->make_request_fn and move it to the block_device_operations
Hi Jens, this series moves the make_request_fn method into block_device_operations with the much more descriptive ->submit_bio name. It then also gives generic_make_request a more descriptive name, and further optimize the path to issue to blk-mq, removing the need for the direct_make_request bypass. Diffstat: Documentation/block/biodoc.rst|2 Documentation/block/writeback_cache_control.rst |2 Documentation/fault-injection/fault-injection.rst |2 Documentation/trace/ftrace.rst|4 arch/m68k/emu/nfblock.c |8 arch/xtensa/platforms/iss/simdisk.c |9 block/bio.c | 14 - block/blk-cgroup.c|2 block/blk-core.c | 255 +- block/blk-crypto-fallback.c |2 block/blk-crypto.c|2 block/blk-merge.c | 23 - block/blk-mq.c| 12 - block/blk-throttle.c |4 block/blk.h |5 block/bounce.c|2 drivers/block/brd.c |5 drivers/block/drbd/drbd_int.h |8 drivers/block/drbd/drbd_main.c| 12 - drivers/block/drbd/drbd_receiver.c|2 drivers/block/drbd/drbd_req.c |8 drivers/block/drbd/drbd_worker.c |2 drivers/block/null_blk_main.c | 19 + drivers/block/pktcdvd.c | 15 - drivers/block/ps3vram.c | 20 - drivers/block/rsxx/dev.c | 14 - drivers/block/umem.c | 11 drivers/block/zram/zram_drv.c | 14 - drivers/lightnvm/core.c |8 drivers/lightnvm/pblk-init.c | 16 - drivers/lightnvm/pblk-read.c |2 drivers/md/bcache/bcache.h|2 drivers/md/bcache/btree.c |2 drivers/md/bcache/request.c | 11 drivers/md/bcache/request.h |4 drivers/md/bcache/super.c | 24 +- drivers/md/dm-cache-target.c |6 drivers/md/dm-clone-target.c | 10 drivers/md/dm-crypt.c |6 drivers/md/dm-delay.c |2 drivers/md/dm-era-target.c|2 drivers/md/dm-integrity.c |4 drivers/md/dm-mpath.c |2 drivers/md/dm-raid1.c |2 drivers/md/dm-snap-persistent.c |2 drivers/md/dm-snap.c |6 drivers/md/dm-thin.c |4 drivers/md/dm-verity-target.c |2 drivers/md/dm-writecache.c|2 drivers/md/dm-zoned-target.c |2 drivers/md/dm.c | 41 +-- drivers/md/md-faulty.c|4 drivers/md/md-linear.c|4 drivers/md/md-multipath.c |4 drivers/md/md.c |7 drivers/md/raid0.c|8 drivers/md/raid1.c| 14 - drivers/md/raid10.c | 28 +- drivers/md/raid5.c| 10 drivers/nvdimm/blk.c |5 drivers/nvdimm/btt.c |5 drivers/nvdimm/pmem.c |5 drivers/nvme/host/core.c |1 drivers/nvme/host/multipath.c | 18 - drivers/nvme/host/nvme.h |1 drivers/s390/block/dcssblk.c | 11 drivers/s390/block/xpram.c|8 fs/buffer.c |5 include/linux/blk-mq.h|2 include/linux/blkdev.h| 12 - include/linux/lightnvm.h |3 71 files changed, 387 insertions(+), 408 deletions(-)