2020-08-22 04:22:31

by John Hubbard

[permalink] [raw]
Subject: [PATCH 4/5] bio: introduce BIO_FOLL_PIN flag

Add a new BIO_FOLL_PIN flag to struct bio, whose "short int" flags field
was full, thuse triggering an expansion of the field from 16, to 32
bits. This allows for a nice assertion in bio_release_pages(), that the
bio page release mechanism matches the page acquisition mechanism.

Set BIO_FOLL_PIN whenever pin_user_pages_fast() is used, and check for
BIO_FOLL_PIN before using unpin_user_page().

Signed-off-by: John Hubbard <[email protected]>
---
block/bio.c | 9 +++++++--
block/blk-map.c | 3 ++-
fs/direct-io.c | 4 ++--
include/linux/blk_types.h | 5 +++--
include/linux/uio.h | 5 +++--
lib/iov_iter.c | 9 +++++++--
6 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index 00d548e3c2b8..dd8e85618d5e 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -952,6 +952,9 @@ void bio_release_pages(struct bio *bio, bool mark_dirty)
if (bio_flagged(bio, BIO_NO_PAGE_REF))
return;

+ if (WARN_ON_ONCE(!bio_flagged(bio, BIO_FOLL_PIN)))
+ return;
+
bio_for_each_segment_all(bvec, bio, iter_all) {
if (mark_dirty && !PageCompound(bvec->bv_page))
set_page_dirty_lock(bvec->bv_page);
@@ -1009,7 +1012,8 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
BUILD_BUG_ON(PAGE_PTRS_PER_BVEC < 2);
pages += entries_left * (PAGE_PTRS_PER_BVEC - 1);

- size = iov_iter_pin_user_pages(iter, pages, LONG_MAX, nr_pages, &offset);
+ size = iov_iter_pin_user_pages(bio, iter, pages, LONG_MAX, nr_pages,
+ &offset);
if (unlikely(size <= 0))
return size ? size : -EFAULT;

@@ -1056,7 +1060,8 @@ static int __bio_iov_append_get_pages(struct bio *bio, struct iov_iter *iter)
BUILD_BUG_ON(PAGE_PTRS_PER_BVEC < 2);
pages += entries_left * (PAGE_PTRS_PER_BVEC - 1);

- size = iov_iter_pin_user_pages(iter, pages, LONG_MAX, nr_pages, &offset);
+ size = iov_iter_pin_user_pages(bio, iter, pages, LONG_MAX, nr_pages,
+ &offset);
if (unlikely(size <= 0))
return size ? size : -EFAULT;

diff --git a/block/blk-map.c b/block/blk-map.c
index 7a095b4947ea..ddfff2f0b1cb 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -275,7 +275,8 @@ static struct bio *bio_map_user_iov(struct request_queue *q,
size_t offs, added = 0;
int npages;

- bytes = iov_iter_pin_user_pages_alloc(iter, &pages, LONG_MAX, &offs);
+ bytes = iov_iter_pin_user_pages_alloc(bio, iter, &pages,
+ LONG_MAX, &offs);
if (unlikely(bytes <= 0)) {
ret = bytes ? bytes : -EFAULT;
goto out_unmap;
diff --git a/fs/direct-io.c b/fs/direct-io.c
index b01c8d003bd3..4d0787ba85eb 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -170,8 +170,8 @@ static inline int dio_refill_pages(struct dio *dio, struct dio_submit *sdio)
{
ssize_t ret;

- ret = iov_iter_pin_user_pages(sdio->iter, dio->pages, LONG_MAX, DIO_PAGES,
- &sdio->from);
+ ret = iov_iter_pin_user_pages(sdio->bio, sdio->iter, dio->pages,
+ LONG_MAX, DIO_PAGES, &sdio->from);

if (ret < 0 && sdio->blocks_available && (dio->op == REQ_OP_WRITE)) {
struct page *page = ZERO_PAGE(0);
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 4ecf4fed171f..d0e0da762af3 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -188,7 +188,7 @@ struct bio {
* top bits REQ_OP. Use
* accessors.
*/
- unsigned short bi_flags; /* status, etc and bvec pool number */
+ unsigned int bi_flags; /* status, etc and bvec pool number */
unsigned short bi_ioprio;
unsigned short bi_write_hint;
blk_status_t bi_status;
@@ -267,6 +267,7 @@ enum {
* of this bio. */
BIO_CGROUP_ACCT, /* has been accounted to a cgroup */
BIO_TRACKED, /* set if bio goes through the rq_qos path */
+ BIO_FOLL_PIN, /* must release pages via unpin_user_pages() */
BIO_FLAG_LAST
};

@@ -285,7 +286,7 @@ enum {
* freed.
*/
#define BVEC_POOL_BITS (3)
-#define BVEC_POOL_OFFSET (16 - BVEC_POOL_BITS)
+#define BVEC_POOL_OFFSET (32 - BVEC_POOL_BITS)
#define BVEC_POOL_IDX(bio) ((bio)->bi_flags >> BVEC_POOL_OFFSET)
#if (1<< BVEC_POOL_BITS) < (BVEC_POOL_NR+1)
# error "BVEC_POOL_BITS is too small"
diff --git a/include/linux/uio.h b/include/linux/uio.h
index 29b0504a27cc..62bcf5e45f2b 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -209,6 +209,7 @@ size_t copy_to_iter_mcsafe(void *addr, size_t bytes, struct iov_iter *i)
return _copy_to_iter_mcsafe(addr, bytes, i);
}

+struct bio;
size_t iov_iter_zero(size_t bytes, struct iov_iter *);
unsigned long iov_iter_alignment(const struct iov_iter *i);
unsigned long iov_iter_gap_alignment(const struct iov_iter *i);
@@ -229,9 +230,9 @@ int iov_iter_npages(const struct iov_iter *i, int maxpages);

const void *dup_iter(struct iov_iter *new, struct iov_iter *old, gfp_t flags);

-ssize_t iov_iter_pin_user_pages(struct iov_iter *i, struct page **pages,
+ssize_t iov_iter_pin_user_pages(struct bio *bio, struct iov_iter *i, struct page **pages,
size_t maxsize, unsigned int maxpages, size_t *start);
-ssize_t iov_iter_pin_user_pages_alloc(struct iov_iter *i, struct page ***pages,
+ssize_t iov_iter_pin_user_pages_alloc(struct bio *bio, struct iov_iter *i, struct page ***pages,
size_t maxsize, size_t *start);

static inline size_t iov_iter_count(const struct iov_iter *i)
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index d818b16d136b..a4bc1b3a3fda 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -3,6 +3,7 @@
#include <linux/export.h>
#include <linux/bvec.h>
#include <linux/uio.h>
+#include <linux/bio.h>
#include <linux/pagemap.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
@@ -1309,7 +1310,7 @@ static ssize_t pipe_get_pages(struct iov_iter *i,
return __pipe_get_pages(i, min(maxsize, capacity), pages, iter_head, start);
}

-ssize_t iov_iter_pin_user_pages(struct iov_iter *i,
+ssize_t iov_iter_pin_user_pages(struct bio *bio, struct iov_iter *i,
struct page **pages, size_t maxsize, unsigned int maxpages,
size_t *start)
{
@@ -1335,6 +1336,8 @@ ssize_t iov_iter_pin_user_pages(struct iov_iter *i,
addr &= ~(PAGE_SIZE - 1);
n = DIV_ROUND_UP(len, PAGE_SIZE);

+ bio_set_flag(bio, BIO_FOLL_PIN);
+
res = pin_user_pages_fast(addr, n,
iov_iter_rw(i) != WRITE ? FOLL_WRITE : 0,
pages);
@@ -1426,7 +1429,7 @@ static ssize_t pipe_get_pages_alloc(struct iov_iter *i,
return n;
}

-ssize_t iov_iter_pin_user_pages_alloc(struct iov_iter *i,
+ssize_t iov_iter_pin_user_pages_alloc(struct bio *bio, struct iov_iter *i,
struct page ***pages, size_t maxsize,
size_t *start)
{
@@ -1454,6 +1457,8 @@ ssize_t iov_iter_pin_user_pages_alloc(struct iov_iter *i,
if (!p)
return -ENOMEM;

+ bio_set_flag(bio, BIO_FOLL_PIN);
+
res = pin_user_pages_fast(addr, n,
iov_iter_rw(i) != WRITE ? FOLL_WRITE : 0, p);
if (unlikely(res < 0)) {
--
2.28.0


2020-08-23 06:36:27

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 4/5] bio: introduce BIO_FOLL_PIN flag

On Fri, Aug 21, 2020 at 09:20:58PM -0700, John Hubbard wrote:
> Add a new BIO_FOLL_PIN flag to struct bio, whose "short int" flags field
> was full, thuse triggering an expansion of the field from 16, to 32
> bits. This allows for a nice assertion in bio_release_pages(), that the
> bio page release mechanism matches the page acquisition mechanism.
>
> Set BIO_FOLL_PIN whenever pin_user_pages_fast() is used, and check for
> BIO_FOLL_PIN before using unpin_user_page().

When would the flag not be set when BIO_NO_PAGE_REF is not set?

Also I don't think we can't just expand the flags field, but I can send
a series to kill off two flags.

2020-08-23 07:05:45

by John Hubbard

[permalink] [raw]
Subject: Re: [PATCH 4/5] bio: introduce BIO_FOLL_PIN flag

On 8/22/20 11:25 PM, Christoph Hellwig wrote:
> On Fri, Aug 21, 2020 at 09:20:58PM -0700, John Hubbard wrote:
>> Add a new BIO_FOLL_PIN flag to struct bio, whose "short int" flags field
>> was full, thuse triggering an expansion of the field from 16, to 32
>> bits. This allows for a nice assertion in bio_release_pages(), that the
>> bio page release mechanism matches the page acquisition mechanism.
>>
>> Set BIO_FOLL_PIN whenever pin_user_pages_fast() is used, and check for
>> BIO_FOLL_PIN before using unpin_user_page().
>
> When would the flag not be set when BIO_NO_PAGE_REF is not set?

Well, I don't *think* you can get there. However, I've only been studying
bio/block for a fairly short time, and the scattering of get_page() and
put_page() calls in some of the paths made me wonder if, for example,
someone was using get_page() to acquire ITER_BVEC or ITER_KVEC via
get_page(), and release them via bio_release_pages(). It's hard to tell.

It seems like that shouldn't be part of the design. I'm asserting that
it isn't, with this new flag. But if you're sure that this assertion is
unnecessary, then let's just drop this patch, of course.

>
> Also I don't think we can't just expand the flags field, but I can send
> a series to kill off two flags.
>

Good to know, just in case we do want this flag. Great!

thanks,
--
John Hubbard
NVIDIA

2020-08-24 07:38:37

by John Hubbard

[permalink] [raw]
Subject: Re: [PATCH 4/5] bio: introduce BIO_FOLL_PIN flag

On 8/22/20 11:57 PM, John Hubbard wrote:
> On 8/22/20 11:25 PM, Christoph Hellwig wrote:
>> On Fri, Aug 21, 2020 at 09:20:58PM -0700, John Hubbard wrote:
>>> Add a new BIO_FOLL_PIN flag to struct bio, whose "short int" flags field
>>> was full, thuse triggering an expansion of the field from 16, to 32
>>> bits. This allows for a nice assertion in bio_release_pages(), that the
>>> bio page release mechanism matches the page acquisition mechanism.
>>>
>>> Set BIO_FOLL_PIN whenever pin_user_pages_fast() is used, and check for
>>> BIO_FOLL_PIN before using unpin_user_page().
>>
>> When would the flag not be set when BIO_NO_PAGE_REF is not set?
>
> Well, I don't *think* you can get there. However, I've only been studying
> bio/block for a fairly short time, and the scattering of get_page() and
> put_page() calls in some of the paths made me wonder if, for example,
> someone was using get_page() to acquire ITER_BVEC or ITER_KVEC via
> get_page(), and release them via bio_release_pages(). It's hard to tell.
>
> It seems like that shouldn't be part of the design. I'm asserting that
> it isn't, with this new flag. But if you're sure that this assertion is
> unnecessary, then let's just drop this patch, of course.
>

Also, I should have done a few more subsystem conversions, before
concluding that BIO_FOLL_PIN was a good idea. Now, as I'm working through mopping
up those other subsystems, I see that nfs/direct.c for example does not have access
to a bio instance, and so the whole thing is not really a great move, at least not
for adding to the iov_iter_pin_user_pages*() APIs.

Let's just drop this patch, after all.


thanks,
--
John Hubbard
NVIDIA

2020-08-24 09:21:35

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH 4/5] bio: introduce BIO_FOLL_PIN flag

On 8/23/20 12:25 AM, Christoph Hellwig wrote:
> On Fri, Aug 21, 2020 at 09:20:58PM -0700, John Hubbard wrote:
>> Add a new BIO_FOLL_PIN flag to struct bio, whose "short int" flags field
>> was full, thuse triggering an expansion of the field from 16, to 32
>> bits. This allows for a nice assertion in bio_release_pages(), that the
>> bio page release mechanism matches the page acquisition mechanism.
>>
>> Set BIO_FOLL_PIN whenever pin_user_pages_fast() is used, and check for
>> BIO_FOLL_PIN before using unpin_user_page().
>
> When would the flag not be set when BIO_NO_PAGE_REF is not set?
>
> Also I don't think we can't just expand the flags field, but I can send
> a series to kill off two flags.

(not relevant to this series as this patch has thankfully already been
dropped, just in general - but yes, definitely need a *strong* justification
to bump the bio size).

Would actually be nice to kill off a few flags, if possible, so the
flags space isn't totally full.

--
Jens Axboe

2020-08-24 14:44:55

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 4/5] bio: introduce BIO_FOLL_PIN flag

On Mon, Aug 24, 2020 at 03:20:26AM -0600, Jens Axboe wrote:
> (not relevant to this series as this patch has thankfully already been
> dropped, just in general - but yes, definitely need a *strong* justification
> to bump the bio size).
>
> Would actually be nice to kill off a few flags, if possible, so the
> flags space isn't totally full.

I have a series to kill two flags that I need to resurrect and post.

2020-08-27 03:30:42

by kernel test robot

[permalink] [raw]
Subject: [bio] 37abbdc72e: WARNING:at_block/bio.c:#bio_release_pages

Greeting,

FYI, we noticed the following commit (built with gcc-9):

commit: 37abbdc72ec00a133b4b93f8d7ff9559a41da4e0 ("[PATCH 4/5] bio: introduce BIO_FOLL_PIN flag")
url: https://github.com/0day-ci/linux/commits/John-Hubbard/bio-Direct-IO-convert-to-pin_user_pages_fast/20200822-122250
base: https://git.kernel.org/cgit/linux/kernel/git/axboe/linux-block.git for-next

in testcase: ltp
with following parameters:

disk: 1HDD
fs: ext4
test: ltp-aiodio.part2
ucode: 0x21

test-description: The LTP testsuite contains a collection of tools for testing the Linux kernel and related features.
test-url: http://linux-test-project.github.io/


on test machine: 4 threads Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz with 8G memory

caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):


+----------------+------------+------------+
| | 0f01c02dee | 37abbdc72e |
+----------------+------------+------------+
| boot_successes | 0 | 0 |
+----------------+------------+------------+


If you fix the issue, kindly add following tag
Reported-by: kernel test robot <[email protected]>


user :notice: [ 56.877035] INFO: creating /lkp/benchmarks/ltp/output directory

user :notice: [ 56.881385] INFO: creating /lkp/benchmarks/ltp/results directory

user :notice: [ 56.886110] Checking for required user/group ids


user :notice: [ 56.896602] 'nobody' user id and group found.

user :notice: [ 56.900161] 'bin' user id and group found.

user :notice: [ 56.903809] 'daemon' user id and group found.

user :notice: [ 56.907197] Users group found.

user :notice: [ 56.910336] Sys group found.

user :notice: [ 56.913550] Required users/groups exist.

user :notice: [ 56.918766] If some fields are empty or look unusual you may have an old version.

user :notice: [ 56.924550] Compare to the current minimal requirements in Documentation/Changes.


user :notice: [ 56.929676] /etc/os-release

user :notice: [ 56.933350] PRETTY_NAME="Debian GNU/Linux 10 (buster)"

user :notice: [ 56.936986] NAME="Debian GNU/Linux"

user :notice: [ 56.939723] VERSION_ID="10"

user :notice: [ 56.942553] VERSION="10 (buster)"

user :notice: [ 56.945702] VERSION_CODENAME=buster

user :notice: [ 56.947515] ID=debian

user :notice: [ 56.949931] HOME_URL="https://www.debian.org/"

user :notice: [ 56.952557] SUPPORT_URL="https://www.debian.org/support"

user :notice: [ 56.955001] BUG_REPORT_URL="https://bugs.debian.org/"


user :notice: [ 56.956962] uname:

user :notice: [ 56.960871] Linux lkp-ivb-d02 5.8.0-10182-g37abbdc72ec00 #1 SMP Thu Aug 27 06:01:27 CST 2020 x86_64 GNU/Linux


user :notice: [ 56.963851] /proc/cmdline

user :warn : [ 57.009433] LTP: starting ADSP000 (aiodio_sparse)
user :warn : [ 59.571766] LTP: starting ADSP001 (aiodio_sparse -s 180k)
user :warn : [ 59.709771] LTP: starting ADSP002 (aiodio_sparse -dd -s 1751k -w 11k)
kern :warn : [ 59.757746] ------------[ cut here ]------------
kern :warn : [ 59.758325] WARNING: CPU: 3 PID: 2581 at block/bio.c:955 bio_release_pages+0xd7/0xe0
kern :warn : [ 59.758952] Modules linked in: dm_mod netconsole btrfs blake2b_generic xor zstd_compress raid6_pq libcrc32c intel_rapl_msr sd_mod intel_rapl_common t10_pi x86_pkg_temp_thermal sg intel_powerclamp coretemp i915 intel_gtt drm_kms_helper kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel syscopyarea rapl intel_cstate sysfillrect intel_uncore sysimgblt fb_sys_fops drm mei_me ipmi_devintf ahci libahci ipmi_msghandler libata mei joydev ie31200_edac video ip_tables
kern :warn : [ 59.761834] CPU: 3 PID: 2581 Comm: aiodio_sparse Not tainted 5.8.0-10182-g37abbdc72ec00 #1
kern :warn : [ 59.762559] Hardware name: Hewlett-Packard p6-1451cx/2ADA, BIOS 8.15 02/05/2013
kern :warn : [ 59.763295] RIP: 0010:bio_release_pages+0xd7/0xe0
kern :warn : [ 59.763983] Code: e1 89 d5 81 e2 ff 0f 00 00 c1 ed 0c 29 d1 48 c1 e5 06 48 03 28 eb 9c 48 8b 45 08 a8 01 75 c0 48 89 ef e8 8c f0 d2 ff eb b6 c3 <0f> 0b c3 66 0f 1f 44 00 00 0f 1f 44 00 00 41 54 31 c0 55 bd 00 10
kern :warn : [ 59.765596] RSP: 0000:ffffc90000124e68 EFLAGS: 00010246
kern :warn : [ 59.766339] RAX: 0000000000000a00 RBX: ffff888212c3f2a0 RCX: 0000000000000000
kern :warn : [ 59.767124] RDX: fffffffffff41387 RSI: 0000000000000000 RDI: ffff88821fae3000
kern :warn : [ 59.767950] RBP: ffff88821fae3000 R08: ffff88821f1d1c00 R09: 0000000000000000
kern :warn : [ 59.768726] R10: ffff88821f1d1a10 R11: ffff88821faab3b0 R12: 0000000040000001
kern :warn : [ 59.769513] R13: 0000000000000400 R14: 0000000000002c00 R15: 0000000000000000
kern :warn : [ 59.770294] FS: 00007fb0401ef740(0000) GS:ffff88821fb80000(0000) knlGS:0000000000000000
kern :warn : [ 59.771112] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kern :warn : [ 59.771908] CR2: 00007ffc3fc11000 CR3: 000000012477e006 CR4: 00000000001706e0
kern :warn : [ 59.772720] Call Trace:
kern :warn : [ 59.773466] <IRQ>
kern :warn : [ 59.774200] iomap_dio_bio_end_io+0x5f/0x100
kern :warn : [ 59.774973] blk_update_request+0x219/0x3c0
kern :warn : [ 59.775767] scsi_end_request+0x29/0x140
kern :warn : [ 59.776538] scsi_io_completion+0x7a/0x520
kern :warn : [ 59.777324] blk_done_softirq+0x95/0xc0
kern :warn : [ 59.778098] __do_softirq+0xe8/0x313
kern :warn : [ 59.778887] asm_call_on_stack+0x12/0x20
kern :warn : [ 59.779662] </IRQ>
kern :warn : [ 59.780435] do_softirq_own_stack+0x39/0x60
kern :warn : [ 59.781217] irq_exit_rcu+0xd2/0xe0
kern :warn : [ 59.782020] common_interrupt+0x74/0x140
kern :warn : [ 59.782797] ? asm_common_interrupt+0x8/0x40
kern :warn : [ 59.783594] asm_common_interrupt+0x1e/0x40
kern :warn : [ 59.784359] RIP: 0033:0x5572c6b47f20
kern :warn : [ 59.785119] Code: 10 00 00 49 01 c4 44 39 fd 0f 8c a2 00 00 00 ba 00 10 00 00 4c 89 ee 44 89 f7 e8 ab f5 ff ff 85 c0 7e d7 89 c2 4c 89 eb eb 09 <48> 83 c3 01 83 ea 01 74 c7 44 0f be 03 45 84 c0 74 ee 83 fa 03 7e
kern :warn : [ 59.786952] RSP: 002b:00007ffc3fc0fed0 EFLAGS: 00000246
kern :warn : [ 59.787836] RAX: 0000000000001000 RBX: 00007ffc3fc11de1 RCX: 00007fb0403c950e
kern :warn : [ 59.788750] RDX: 00000000000000bf RSI: 00007ffc3fc10ea0 RDI: 0000000000000007
kern :warn : [ 59.789647] RBP: 00000000001b5c00 R08: 0000000000000000 R09: 00007ffc3fc0d6b7
kern :warn : [ 59.790550] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000003e000
kern :warn : [ 59.791447] R13: 00007ffc3fc10ea0 R14: 0000000000000007 R15: 000000000003e000
kern :warn : [ 59.792356] ---[ end trace 1c52c540ed6c08e4 ]---


To reproduce:

git clone https://github.com/intel/lkp-tests.git
cd lkp-tests
bin/lkp install job.yaml # job file is attached in this email
bin/lkp run job.yaml



Thanks,
lkp


Attachments:
(No filename) (6.92 kB)
config-5.8.0-10182-g37abbdc72ec00 (172.64 kB)
job-script (6.05 kB)
kmsg.xz (33.50 kB)
ltp (90.12 kB)
job.yaml (5.05 kB)
reproduce (247.00 B)
Download all attachments

2020-08-27 04:00:49

by John Hubbard

[permalink] [raw]
Subject: Re: [bio] 37abbdc72e: WARNING:at_block/bio.c:#bio_release_pages

On 8/26/20 8:25 PM, kernel test robot wrote:
...
> kern :warn : [ 59.757746] ------------[ cut here ]------------
> kern :warn : [ 59.758325] WARNING: CPU: 3 PID: 2581 at block/bio.c:955 bio_release_pages+0xd7/0xe0
> kern :warn : [ 59.758952] Modules linked in: dm_mod netconsole btrfs blake2b_generic xor zstd_compress raid6_pq libcrc32c intel_rapl_msr sd_mod intel_rapl_common t10_pi x86_pkg_temp_thermal sg intel_powerclamp coretemp i915 intel_gtt drm_kms_helper kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel syscopyarea rapl intel_cstate sysfillrect intel_uncore sysimgblt fb_sys_fops drm mei_me ipmi_devintf ahci libahci ipmi_msghandler libata mei joydev ie31200_edac video ip_tables
> kern :warn : [ 59.761834] CPU: 3 PID: 2581 Comm: aiodio_sparse Not tainted 5.8.0-10182-g37abbdc72ec00 #1
> kern :warn : [ 59.762559] Hardware name: Hewlett-Packard p6-1451cx/2ADA, BIOS 8.15 02/05/2013
> kern :warn : [ 59.763295] RIP: 0010:bio_release_pages+0xd7/0xe0
> kern :warn : [ 59.763983] Code: e1 89 d5 81 e2 ff 0f 00 00 c1 ed 0c 29 d1 48 c1 e5 06 48 03 28 eb 9c 48 8b 45 08 a8 01 75 c0 48 89 ef e8 8c f0 d2 ff eb b6 c3 <0f> 0b c3 66 0f 1f 44 00 00 0f 1f 44 00 00 41 54 31 c0 55 bd 00 10
> kern :warn : [ 59.765596] RSP: 0000:ffffc90000124e68 EFLAGS: 00010246
> kern :warn : [ 59.766339] RAX: 0000000000000a00 RBX: ffff888212c3f2a0 RCX: 0000000000000000
> kern :warn : [ 59.767124] RDX: fffffffffff41387 RSI: 0000000000000000 RDI: ffff88821fae3000
> kern :warn : [ 59.767950] RBP: ffff88821fae3000 R08: ffff88821f1d1c00 R09: 0000000000000000
> kern :warn : [ 59.768726] R10: ffff88821f1d1a10 R11: ffff88821faab3b0 R12: 0000000040000001
> kern :warn : [ 59.769513] R13: 0000000000000400 R14: 0000000000002c00 R15: 0000000000000000
> kern :warn : [ 59.770294] FS: 00007fb0401ef740(0000) GS:ffff88821fb80000(0000) knlGS:0000000000000000
> kern :warn : [ 59.771112] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> kern :warn : [ 59.771908] CR2: 00007ffc3fc11000 CR3: 000000012477e006 CR4: 00000000001706e0
> kern :warn : [ 59.772720] Call Trace:
> kern :warn : [ 59.773466] <IRQ>
> kern :warn : [ 59.774200] iomap_dio_bio_end_io+0x5f/0x100

ah, this is self-inflicted, because my new pin_user_page() (which is called
from iomap_dio_bio_end_io) doesn't set BIO_FOLL_PIN.

Obsolete, now that BIO_FOLL_PIN is not going to happen, but it's good to see
that the system isn't doing anything unexpected here.

thanks,
--
John Hubbard
NVIDIA

> kern :warn : [ 59.774973] blk_update_request+0x219/0x3c0
> kern :warn : [ 59.775767] scsi_end_request+0x29/0x140
> kern :warn : [ 59.776538] scsi_io_completion+0x7a/0x520
> kern :warn : [ 59.777324] blk_done_softirq+0x95/0xc0
> kern :warn : [ 59.778098] __do_softirq+0xe8/0x313
> kern :warn : [ 59.778887] asm_call_on_stack+0x12/0x20
> kern :warn : [ 59.779662] </IRQ>
> kern :warn : [ 59.780435] do_softirq_own_stack+0x39/0x60
> kern :warn : [ 59.781217] irq_exit_rcu+0xd2/0xe0
> kern :warn : [ 59.782020] common_interrupt+0x74/0x140
> kern :warn : [ 59.782797] ? asm_common_interrupt+0x8/0x40
> kern :warn : [ 59.783594] asm_common_interrupt+0x1e/0x40
> kern :warn : [ 59.784359] RIP: 0033:0x5572c6b47f20
> kern :warn : [ 59.785119] Code: 10 00 00 49 01 c4 44 39 fd 0f 8c a2 00 00 00 ba 00 10 00 00 4c 89 ee 44 89 f7 e8 ab f5 ff ff 85 c0 7e d7 89 c2 4c 89 eb eb 09 <48> 83 c3 01 83 ea 01 74 c7 44 0f be 03 45 84 c0 74 ee 83 fa 03 7e
> kern :warn : [ 59.786952] RSP: 002b:00007ffc3fc0fed0 EFLAGS: 00000246
> kern :warn : [ 59.787836] RAX: 0000000000001000 RBX: 00007ffc3fc11de1 RCX: 00007fb0403c950e
> kern :warn : [ 59.788750] RDX: 00000000000000bf RSI: 00007ffc3fc10ea0 RDI: 0000000000000007
> kern :warn : [ 59.789647] RBP: 00000000001b5c00 R08: 0000000000000000 R09: 00007ffc3fc0d6b7
> kern :warn : [ 59.790550] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000003e000
> kern :warn : [ 59.791447] R13: 00007ffc3fc10ea0 R14: 0000000000000007 R15: 000000000003e000
> kern :warn : [ 59.792356] ---[ end trace 1c52c540ed6c08e4 ]---
>
> ...