From patchwork Wed May 9 07:54:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10388583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 89F5A602C2 for ; Wed, 9 May 2018 07:54:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E95320223 for ; Wed, 9 May 2018 07:54:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7319B28E6C; Wed, 9 May 2018 07:54:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B921020223 for ; Wed, 9 May 2018 07:54:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E18D96B0393; Wed, 9 May 2018 03:54:51 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DC79A6B0395; Wed, 9 May 2018 03:54:51 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C966F6B0396; Wed, 9 May 2018 03:54:51 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f71.google.com (mail-pl0-f71.google.com [209.85.160.71]) by kanga.kvack.org (Postfix) with ESMTP id 8415C6B0393 for ; Wed, 9 May 2018 03:54:51 -0400 (EDT) Received: by mail-pl0-f71.google.com with SMTP id a6-v6so3312144pll.22 for ; Wed, 09 May 2018 00:54:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=IRRf3idDeK97CGroV7fKY6kmc0t/v1Wasc0uCQO70cc=; b=StZbmUrnOqVxS3Us9WHLwTEDRPwdowpJyGkggHh5SYRRy7iqrgDp9cnfVyrNeo2irq G8kG1It5BQF2n994TMj8HyI9YngCUaGsXRunthioRhD/ebgRscuu+bhpbbKXcPUnB38Z N/GZF37psm/OHjMcBR5h5Usu1CJXB52uLFxFVTMxNii3CJ+HsiWjEy5eUseHsR9fD85/ 1bf9cyVKNVK3FuOy3WCYe3muLhkyY5+CKQ0OH7wYX0QXGqs35QMlATTdliY4Mb3zBy9w nzKAggw/B9GHwc1FTjGO/dxBgZMOvTicovPF5c13H0e0zlsr6wHh2PPMWEqcfkhVZMN1 eMbA== X-Gm-Message-State: ALQs6tDsEr6HVrNIL2Wz7tu4gT/bUJYMYx99h6SKiKEOBHo2vOAQ1U07 xgyA/heVxkM/rDZxa+RQffDMrPZwjbgu6NcFiSscuyXLC90eiyimeRvKyS8eD+FCRHTPd+vF+GR iuR71MLRZjmC1PXRU5Oriydvm0BV1cVCM++SHpzJMI/y38ILGKdLsoJsQ2IKhOuE= X-Received: by 2002:a65:62ca:: with SMTP id m10-v6mr35716889pgv.348.1525852491206; Wed, 09 May 2018 00:54:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoa8MF31CnsMmHVEShjg1Y7eR+FMENnIr1RPweq5ve64wAzGL7sN4Uc2IgihVigvX9Ag+aE X-Received: by 2002:a65:62ca:: with SMTP id m10-v6mr35716855pgv.348.1525852490311; Wed, 09 May 2018 00:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525852490; cv=none; d=google.com; s=arc-20160816; b=Crdg0AhuLlWrGGLbJM7TJV8fDtdCv9mw0JKoMenaLKhj+8w/SUUAOu/AZBxesf82tU 9TBELmHK4iX8n77Xb1hgK56XGWzqrL9ysrsa1vjk9IZz9xKaXzkSkprWJ1HSaYWUwoWx oDKb82l+pOP0yQE4jAQpvCMZZwxXwx4NCqMmfvHXO06Iz5flyijDhOIXJrblDwJ7IJQw hadliKPDRq+C04w/XtIR9HMJ9DBN3SUJuAQC3lWAKeRYJmxEkxR9QK7JO6pD0NxqxVvy c67Zt4ZhLXGp8RxVQo5Fk1CstWK9uKao7894af60eqihYIt3+fb9T7EfUNE++vIeGwVL zZfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=IRRf3idDeK97CGroV7fKY6kmc0t/v1Wasc0uCQO70cc=; b=EFN/F58vCiA0CUE36cIiYpxbqDCJ06obJyT7HH0LOMsBKzBbRXvebXPcKTCJ6poLKy fGckfRyOK5JlGatCVLviL7mjdqPlts0q7cy6uFJtU6IxXrF1BfWdAQxT7AoOkw+ylHa6 N9gaRkjK4OQHjMLtKN93St3ZHjfH9WBBuf12O4vmU9k/Y0o6sxawGwv68EGw+CbTc3uT bozRU6dLErOMB5T9NA5KAs7QfJZOTckZf+OnG0q7XfLYxECgCh4JqNLMFa3HbadiJrr5 R7GvD9bBqckrJsinbIAeJ2ohbUBGwBQJj+wkB2wyEZ6hdbuoUDFYffWIt9dYLqIBlIZ5 GBHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=f/1Gcnh+; spf=pass (google.com: best guess record for domain of batv+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org designates 198.137.202.133 as permitted sender) smtp.mailfrom=BATV+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [198.137.202.133]) by mx.google.com with ESMTPS id j19-v6si1533028pll.518.2018.05.09.00.54.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 May 2018 00:54:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of batv+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org designates 198.137.202.133 as permitted sender) client-ip=198.137.202.133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=f/1Gcnh+; spf=pass (google.com: best guess record for domain of batv+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org designates 198.137.202.133 as permitted sender) smtp.mailfrom=BATV+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IRRf3idDeK97CGroV7fKY6kmc0t/v1Wasc0uCQO70cc=; b=f/1Gcnh+0C9+RUzxyR1UUHBgC 1SVEiW2Gfym3RCRaNWJdVBeSLlyICwdVK3a0tm8pgUI7NlN80rTHxkZPBjo7bX1YZyWX2A2KQL0fj yVEg12y7efOmXmfhm5y7tbGI9WjO0tB5s2R9fFXvWXTVxgw17djwI+ARlAlCOcWtMZ45qUnPoXfN9 LdSRu0UYc4+XJAArXM5HW0bJo9KK2LDIoHYSN37ZNcjWHzq6bhYhUrQWQEblPaFlXoFf5Rt4itPH9 /QVRZcZ5JlBc/a6+rrbag2tQdaJzaRFzc1S39XJPFA8pVWdKeDNMHZgpwOHe6EmwYw0QreAGi8PhO BOik6s4ZQ==; Received: from 213-225-15-246.nat.highway.a1.net ([213.225.15.246] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGJvt-0004PB-J3; Wed, 09 May 2018 07:54:42 +0000 From: Christoph Hellwig To: axboe@kernel.dk Cc: Bart.VanAssche@wdc.com, willy@infradead.org, linux-block@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 6/6] block: consistently use GFP_NOIO instead of __GFP_NORECLAIM Date: Wed, 9 May 2018 09:54:08 +0200 Message-Id: <20180509075408.16388-7-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509075408.16388-1-hch@lst.de> References: <20180509075408.16388-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Same numerical value (for now at least), but a much better documentation of intent. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche --- block/scsi_ioctl.c | 2 +- drivers/block/drbd/drbd_bitmap.c | 3 ++- drivers/block/pktcdvd.c | 2 +- drivers/ide/ide-tape.c | 2 +- drivers/ide/ide-taskfile.c | 2 +- drivers/scsi/scsi_lib.c | 2 +- fs/direct-io.c | 4 ++-- kernel/power/swap.c | 14 +++++++------- 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 04b54f9a4152..533f4aee8567 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -499,7 +499,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode, break; } - if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, __GFP_RECLAIM)) { + if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, GFP_NOIO)) { err = DRIVER_ERROR << 24; goto error; } diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 9f4e6f502b84..d82237d534cf 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -1014,7 +1014,8 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho bm_set_page_unchanged(b->bm_pages[page_nr]); if (ctx->flags & BM_AIO_COPY_PAGES) { - page = mempool_alloc(drbd_md_io_page_pool, __GFP_HIGHMEM|__GFP_RECLAIM); + page = mempool_alloc(drbd_md_io_page_pool, + GFP_NOIO | __GFP_HIGHMEM); copy_highpage(page, b->bm_pages[page_nr]); bm_store_page_idx(page, page_nr); } else diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 4880a4a9f52d..ccfcf544830f 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -710,7 +710,7 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command * if (cgc->buflen) { ret = blk_rq_map_kern(q, rq, cgc->buffer, cgc->buflen, - __GFP_RECLAIM); + GFP_NOIO); if (ret) goto out; } diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 66661031f3f1..62c1a19a9aed 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c @@ -862,7 +862,7 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int size) if (size) { ret = blk_rq_map_kern(drive->queue, rq, tape->buf, size, - __GFP_RECLAIM); + GFP_NOIO); if (ret) goto out_put; } diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 6308bb0dab50..c034cd965831 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -442,7 +442,7 @@ int ide_raw_taskfile(ide_drive_t *drive, struct ide_cmd *cmd, u8 *buf, */ if (nsect) { error = blk_rq_map_kern(drive->queue, rq, buf, - nsect * SECTOR_SIZE, __GFP_RECLAIM); + nsect * SECTOR_SIZE, GFP_NOIO); if (error) goto put_req; } diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 6b0f3ec487bd..f125fd71c0f2 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -273,7 +273,7 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, rq = scsi_req(req); if (bufflen && blk_rq_map_kern(sdev->request_queue, req, - buffer, bufflen, __GFP_RECLAIM)) + buffer, bufflen, GFP_NOIO)) goto out; rq->cmd_len = COMMAND_SIZE(cmd[0]); diff --git a/fs/direct-io.c b/fs/direct-io.c index 874607bb6e02..093fb54cd316 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -432,8 +432,8 @@ dio_bio_alloc(struct dio *dio, struct dio_submit *sdio, struct bio *bio; /* - * bio_alloc() is guaranteed to return a bio when called with - * __GFP_RECLAIM and we request a valid number of vectors. + * bio_alloc() is guaranteed to return a bio when allowed to sleep and + * we request a valid number of vectors. */ bio = bio_alloc(GFP_KERNEL, nr_vecs); diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 11b4282c2d20..1efcb5b0c3ed 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -269,7 +269,7 @@ static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr, struct bio *bio; int error = 0; - bio = bio_alloc(__GFP_RECLAIM | __GFP_HIGH, 1); + bio = bio_alloc(GFP_NOIO | __GFP_HIGH, 1); bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9); bio_set_dev(bio, hib_resume_bdev); bio_set_op_attrs(bio, op, op_flags); @@ -376,7 +376,7 @@ static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb) return -ENOSPC; if (hb) { - src = (void *)__get_free_page(__GFP_RECLAIM | __GFP_NOWARN | + src = (void *)__get_free_page(GFP_NOIO | __GFP_NOWARN | __GFP_NORETRY); if (src) { copy_page(src, buf); @@ -384,7 +384,7 @@ static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb) ret = hib_wait_io(hb); /* Free pages */ if (ret) return ret; - src = (void *)__get_free_page(__GFP_RECLAIM | + src = (void *)__get_free_page(GFP_NOIO | __GFP_NOWARN | __GFP_NORETRY); if (src) { @@ -691,7 +691,7 @@ static int save_image_lzo(struct swap_map_handle *handle, nr_threads = num_online_cpus() - 1; nr_threads = clamp_val(nr_threads, 1, LZO_THREADS); - page = (void *)__get_free_page(__GFP_RECLAIM | __GFP_HIGH); + page = (void *)__get_free_page(GFP_NOIO | __GFP_HIGH); if (!page) { pr_err("Failed to allocate LZO page\n"); ret = -ENOMEM; @@ -989,7 +989,7 @@ static int get_swap_reader(struct swap_map_handle *handle, last = tmp; tmp->map = (struct swap_map_page *) - __get_free_page(__GFP_RECLAIM | __GFP_HIGH); + __get_free_page(GFP_NOIO | __GFP_HIGH); if (!tmp->map) { release_swap_reader(handle); return -ENOMEM; @@ -1261,8 +1261,8 @@ static int load_image_lzo(struct swap_map_handle *handle, for (i = 0; i < read_pages; i++) { page[i] = (void *)__get_free_page(i < LZO_CMP_PAGES ? - __GFP_RECLAIM | __GFP_HIGH : - __GFP_RECLAIM | __GFP_NOWARN | + GFP_NOIO | __GFP_HIGH : + GFP_NOIO | __GFP_NOWARN | __GFP_NORETRY); if (!page[i]) {