--- x/mm/mmu_gather.c +++ y/mm/mmu_gather.c @@ -26,7 +26,11 @@ static bool tlb_next_batch(struct mmu_ga batch = tlb->active; if (batch->next) { tlb->active = batch->next; - return true; + batch = tlb->active; + if (batch->nr < batch->max) + return true; + else + return false; } if (tlb->batch_count == MAX_GATHER_BATCH_COUNT) --- x/block/bio.c +++ y/block/bio.c @@ -1342,8 +1342,7 @@ int bio_iov_iter_get_pages(struct bio *b return 0; } - if (iov_iter_extract_will_pin(iter)) - bio_set_flag(bio, BIO_PAGE_PINNED); + bio_set_flag(bio, BIO_PAGE_REFFED); do { ret = __bio_iov_iter_get_pages(bio, iter); } while (!ret && iov_iter_count(iter) && !bio_full(bio, 0));