Skip to content

Commit 71baba4

Browse files
gormanmtorvalds
authored andcommitted
mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM
__GFP_WAIT was used to signal that the caller was in atomic context and could not sleep. Now it is possible to distinguish between true atomic context and callers that are not willing to sleep. The latter should clear __GFP_DIRECT_RECLAIM so kswapd will still wake. As clearing __GFP_WAIT behaves differently, there is a risk that people will clear the wrong flags. This patch renames __GFP_WAIT to __GFP_RECLAIM to clearly indicate what it does -- setting it allows all reclaim activity, clearing them prevents it. [[email protected]: fix build] [[email protected]: coding-style fixes] Signed-off-by: Mel Gorman <[email protected]> Acked-by: Michal Hocko <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Acked-by: Johannes Weiner <[email protected]> Cc: Christoph Lameter <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Vitaly Wool <[email protected]> Cc: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4011337 commit 71baba4

File tree

38 files changed

+71
-68
lines changed

38 files changed

+71
-68
lines changed

block/blk-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ int blk_queue_enter(struct request_queue *q, gfp_t gfp)
638638
if (percpu_ref_tryget_live(&q->q_usage_counter))
639639
return 0;
640640

641-
if (!(gfp & __GFP_WAIT))
641+
if (!gfpflags_allow_blocking(gfp))
642642
return -EBUSY;
643643

644644
ret = wait_event_interruptible(q->mq_freeze_wq,
@@ -2038,7 +2038,7 @@ void generic_make_request(struct bio *bio)
20382038
do {
20392039
struct request_queue *q = bdev_get_queue(bio->bi_bdev);
20402040

2041-
if (likely(blk_queue_enter(q, __GFP_WAIT) == 0)) {
2041+
if (likely(blk_queue_enter(q, __GFP_DIRECT_RECLAIM) == 0)) {
20422042

20432043
q->make_request_fn(q, bio);
20442044

block/blk-mq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ static struct request *blk_mq_map_request(struct request_queue *q,
11861186
ctx = blk_mq_get_ctx(q);
11871187
hctx = q->mq_ops->map_queue(q, ctx->cpu);
11881188
blk_mq_set_alloc_data(&alloc_data, q,
1189-
__GFP_WAIT|__GFP_HIGH, false, ctx, hctx);
1189+
__GFP_RECLAIM|__GFP_HIGH, false, ctx, hctx);
11901190
rq = __blk_mq_alloc_request(&alloc_data, rw);
11911191
ctx = alloc_data.ctx;
11921192
hctx = alloc_data.hctx;

block/scsi_ioctl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
444444

445445
}
446446

447-
rq = blk_get_request(q, in_len ? WRITE : READ, __GFP_WAIT);
447+
rq = blk_get_request(q, in_len ? WRITE : READ, __GFP_RECLAIM);
448448
if (IS_ERR(rq)) {
449449
err = PTR_ERR(rq);
450450
goto error_free_buffer;
@@ -495,7 +495,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
495495
break;
496496
}
497497

498-
if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, __GFP_WAIT)) {
498+
if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, __GFP_RECLAIM)) {
499499
err = DRIVER_ERROR << 24;
500500
goto error;
501501
}
@@ -536,7 +536,7 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk,
536536
struct request *rq;
537537
int err;
538538

539-
rq = blk_get_request(q, WRITE, __GFP_WAIT);
539+
rq = blk_get_request(q, WRITE, __GFP_RECLAIM);
540540
if (IS_ERR(rq))
541541
return PTR_ERR(rq);
542542
blk_rq_set_block_pc(rq);

drivers/block/drbd/drbd_bitmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho
10071007
bm_set_page_unchanged(b->bm_pages[page_nr]);
10081008

10091009
if (ctx->flags & BM_AIO_COPY_PAGES) {
1010-
page = mempool_alloc(drbd_md_io_page_pool, __GFP_HIGHMEM|__GFP_WAIT);
1010+
page = mempool_alloc(drbd_md_io_page_pool, __GFP_HIGHMEM|__GFP_RECLAIM);
10111011
copy_highpage(page, b->bm_pages[page_nr]);
10121012
bm_store_page_idx(page, page_nr);
10131013
} else

drivers/block/mtip32xx/mtip32xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static struct mtip_cmd *mtip_get_int_command(struct driver_data *dd)
173173
{
174174
struct request *rq;
175175

176-
rq = blk_mq_alloc_request(dd->queue, 0, __GFP_WAIT, true);
176+
rq = blk_mq_alloc_request(dd->queue, 0, __GFP_RECLAIM, true);
177177
return blk_mq_rq_to_pdu(rq);
178178
}
179179

drivers/block/paride/pd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ static int pd_special_command(struct pd_unit *disk,
723723
struct request *rq;
724724
int err = 0;
725725

726-
rq = blk_get_request(disk->gd->queue, READ, __GFP_WAIT);
726+
rq = blk_get_request(disk->gd->queue, READ, __GFP_RECLAIM);
727727
if (IS_ERR(rq))
728728
return PTR_ERR(rq);
729729

drivers/block/pktcdvd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,14 +704,14 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command *
704704
int ret = 0;
705705

706706
rq = blk_get_request(q, (cgc->data_direction == CGC_DATA_WRITE) ?
707-
WRITE : READ, __GFP_WAIT);
707+
WRITE : READ, __GFP_RECLAIM);
708708
if (IS_ERR(rq))
709709
return PTR_ERR(rq);
710710
blk_rq_set_block_pc(rq);
711711

712712
if (cgc->buflen) {
713713
ret = blk_rq_map_kern(q, rq, cgc->buffer, cgc->buflen,
714-
__GFP_WAIT);
714+
__GFP_RECLAIM);
715715
if (ret)
716716
goto out;
717717
}

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,7 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
22162216
mapping = file_inode(obj->base.filp)->i_mapping;
22172217
gfp = mapping_gfp_mask(mapping);
22182218
gfp |= __GFP_NORETRY | __GFP_NOWARN;
2219-
gfp &= ~(__GFP_IO | __GFP_WAIT);
2219+
gfp &= ~(__GFP_IO | __GFP_RECLAIM);
22202220
sg = st->sgl;
22212221
st->nents = 0;
22222222
for (i = 0; i < page_count; i++) {

drivers/ide/ide-atapi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
9292
struct request *rq;
9393
int error;
9494

95-
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
95+
rq = blk_get_request(drive->queue, READ, __GFP_RECLAIM);
9696
rq->cmd_type = REQ_TYPE_DRV_PRIV;
9797
rq->special = (char *)pc;
9898

drivers/ide/ide-cd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
441441
struct request *rq;
442442
int error;
443443

444-
rq = blk_get_request(drive->queue, write, __GFP_WAIT);
444+
rq = blk_get_request(drive->queue, write, __GFP_RECLAIM);
445445

446446
memcpy(rq->cmd, cmd, BLK_MAX_CDB);
447447
rq->cmd_type = REQ_TYPE_ATA_PC;

drivers/ide/ide-cd_ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ int ide_cdrom_reset(struct cdrom_device_info *cdi)
303303
struct request *rq;
304304
int ret;
305305

306-
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
306+
rq = blk_get_request(drive->queue, READ, __GFP_RECLAIM);
307307
rq->cmd_type = REQ_TYPE_DRV_PRIV;
308308
rq->cmd_flags = REQ_QUIET;
309309
ret = blk_execute_rq(drive->queue, cd->disk, rq, 0);

drivers/ide/ide-devsets.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ int ide_devset_execute(ide_drive_t *drive, const struct ide_devset *setting,
165165
if (!(setting->flags & DS_SYNC))
166166
return setting->set(drive, arg);
167167

168-
rq = blk_get_request(q, READ, __GFP_WAIT);
168+
rq = blk_get_request(q, READ, __GFP_RECLAIM);
169169
rq->cmd_type = REQ_TYPE_DRV_PRIV;
170170
rq->cmd_len = 5;
171171
rq->cmd[0] = REQ_DEVSET_EXEC;

drivers/ide/ide-disk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static int set_multcount(ide_drive_t *drive, int arg)
477477
if (drive->special_flags & IDE_SFLAG_SET_MULTMODE)
478478
return -EBUSY;
479479

480-
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
480+
rq = blk_get_request(drive->queue, READ, __GFP_RECLAIM);
481481
rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
482482

483483
drive->mult_req = arg;

drivers/ide/ide-ioctls.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg)
125125
if (NULL == (void *) arg) {
126126
struct request *rq;
127127

128-
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
128+
rq = blk_get_request(drive->queue, READ, __GFP_RECLAIM);
129129
rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
130130
err = blk_execute_rq(drive->queue, NULL, rq, 0);
131131
blk_put_request(rq);
@@ -221,7 +221,7 @@ static int generic_drive_reset(ide_drive_t *drive)
221221
struct request *rq;
222222
int ret = 0;
223223

224-
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
224+
rq = blk_get_request(drive->queue, READ, __GFP_RECLAIM);
225225
rq->cmd_type = REQ_TYPE_DRV_PRIV;
226226
rq->cmd_len = 1;
227227
rq->cmd[0] = REQ_DRIVE_RESET;

drivers/ide/ide-park.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout)
3131
}
3232
spin_unlock_irq(&hwif->lock);
3333

34-
rq = blk_get_request(q, READ, __GFP_WAIT);
34+
rq = blk_get_request(q, READ, __GFP_RECLAIM);
3535
rq->cmd[0] = REQ_PARK_HEADS;
3636
rq->cmd_len = 1;
3737
rq->cmd_type = REQ_TYPE_DRV_PRIV;

drivers/ide/ide-pm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
1818
}
1919

2020
memset(&rqpm, 0, sizeof(rqpm));
21-
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
21+
rq = blk_get_request(drive->queue, READ, __GFP_RECLAIM);
2222
rq->cmd_type = REQ_TYPE_ATA_PM_SUSPEND;
2323
rq->special = &rqpm;
2424
rqpm.pm_step = IDE_PM_START_SUSPEND;
@@ -88,7 +88,7 @@ int generic_ide_resume(struct device *dev)
8888
}
8989

9090
memset(&rqpm, 0, sizeof(rqpm));
91-
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
91+
rq = blk_get_request(drive->queue, READ, __GFP_RECLAIM);
9292
rq->cmd_type = REQ_TYPE_ATA_PM_RESUME;
9393
rq->cmd_flags |= REQ_PREEMPT;
9494
rq->special = &rqpm;

drivers/ide/ide-tape.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,15 +852,15 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int size)
852852
BUG_ON(cmd != REQ_IDETAPE_READ && cmd != REQ_IDETAPE_WRITE);
853853
BUG_ON(size < 0 || size % tape->blk_size);
854854

855-
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
855+
rq = blk_get_request(drive->queue, READ, __GFP_RECLAIM);
856856
rq->cmd_type = REQ_TYPE_DRV_PRIV;
857857
rq->cmd[13] = cmd;
858858
rq->rq_disk = tape->disk;
859859
rq->__sector = tape->first_frame;
860860

861861
if (size) {
862862
ret = blk_rq_map_kern(drive->queue, rq, tape->buf, size,
863-
__GFP_WAIT);
863+
__GFP_RECLAIM);
864864
if (ret)
865865
goto out_put;
866866
}

drivers/ide/ide-taskfile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ int ide_raw_taskfile(ide_drive_t *drive, struct ide_cmd *cmd, u8 *buf,
430430
int error;
431431
int rw = !(cmd->tf_flags & IDE_TFLAG_WRITE) ? READ : WRITE;
432432

433-
rq = blk_get_request(drive->queue, rw, __GFP_WAIT);
433+
rq = blk_get_request(drive->queue, rw, __GFP_RECLAIM);
434434
rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
435435

436436
/*
@@ -441,7 +441,7 @@ int ide_raw_taskfile(ide_drive_t *drive, struct ide_cmd *cmd, u8 *buf,
441441
*/
442442
if (nsect) {
443443
error = blk_rq_map_kern(drive->queue, rq, buf,
444-
nsect * SECTOR_SIZE, __GFP_WAIT);
444+
nsect * SECTOR_SIZE, __GFP_RECLAIM);
445445
if (error)
446446
goto put_req;
447447
}

drivers/infiniband/hw/qib/qib_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ int qib_setup_eagerbufs(struct qib_ctxtdata *rcd)
16801680
* heavy filesystem activity makes these fail, and we can
16811681
* use compound pages.
16821682
*/
1683-
gfp_flags = __GFP_WAIT | __GFP_IO | __GFP_COMP;
1683+
gfp_flags = __GFP_RECLAIM | __GFP_IO | __GFP_COMP;
16841684

16851685
egrcnt = rcd->rcvegrcnt;
16861686
egroff = rcd->rcvegr_tid_base;

drivers/misc/vmw_balloon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ MODULE_LICENSE("GPL");
7575

7676
/*
7777
* Use __GFP_HIGHMEM to allow pages from HIGHMEM zone. We don't
78-
* allow wait (__GFP_WAIT) for NOSLEEP page allocations. Use
78+
* allow wait (__GFP_RECLAIM) for NOSLEEP page allocations. Use
7979
* __GFP_NOWARN, to suppress page allocation failure warnings.
8080
*/
8181
#define VMW_PAGE_ALLOC_NOSLEEP (__GFP_HIGHMEM|__GFP_NOWARN)

drivers/nvme/host/pci.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,11 +1025,13 @@ int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
10251025
req->special = (void *)0;
10261026

10271027
if (buffer && bufflen) {
1028-
ret = blk_rq_map_kern(q, req, buffer, bufflen, __GFP_WAIT);
1028+
ret = blk_rq_map_kern(q, req, buffer, bufflen,
1029+
__GFP_DIRECT_RECLAIM);
10291030
if (ret)
10301031
goto out;
10311032
} else if (ubuffer && bufflen) {
1032-
ret = blk_rq_map_user(q, req, NULL, ubuffer, bufflen, __GFP_WAIT);
1033+
ret = blk_rq_map_user(q, req, NULL, ubuffer, bufflen,
1034+
__GFP_DIRECT_RECLAIM);
10331035
if (ret)
10341036
goto out;
10351037
bio = req->bio;

drivers/scsi/scsi_error.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,7 @@ static void scsi_eh_lock_door(struct scsi_device *sdev)
19701970
struct request *req;
19711971

19721972
/*
1973-
* blk_get_request with GFP_KERNEL (__GFP_WAIT) sleeps until a
1973+
* blk_get_request with GFP_KERNEL (__GFP_RECLAIM) sleeps until a
19741974
* request becomes available
19751975
*/
19761976
req = blk_get_request(sdev->request_queue, READ, GFP_KERNEL);

drivers/scsi/scsi_lib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,13 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
222222
int write = (data_direction == DMA_TO_DEVICE);
223223
int ret = DRIVER_ERROR << 24;
224224

225-
req = blk_get_request(sdev->request_queue, write, __GFP_WAIT);
225+
req = blk_get_request(sdev->request_queue, write, __GFP_RECLAIM);
226226
if (IS_ERR(req))
227227
return ret;
228228
blk_rq_set_block_pc(req);
229229

230230
if (bufflen && blk_rq_map_kern(sdev->request_queue, req,
231-
buffer, bufflen, __GFP_WAIT))
231+
buffer, bufflen, __GFP_RECLAIM))
232232
goto out;
233233

234234
req->cmd_len = COMMAND_SIZE(cmd[0]);

drivers/staging/rdma/hfi1/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ int hfi1_setup_eagerbufs(struct hfi1_ctxtdata *rcd)
15601560
* heavy filesystem activity makes these fail, and we can
15611561
* use compound pages.
15621562
*/
1563-
gfp_flags = __GFP_WAIT | __GFP_IO | __GFP_COMP;
1563+
gfp_flags = __GFP_RECLAIM | __GFP_IO | __GFP_COMP;
15641564

15651565
/*
15661566
* The minimum size of the eager buffers is a groups of MTU-sized

drivers/staging/rdma/ipath/ipath_file_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ static int ipath_create_user_egr(struct ipath_portdata *pd)
905905
* heavy filesystem activity makes these fail, and we can
906906
* use compound pages.
907907
*/
908-
gfp_flags = __GFP_WAIT | __GFP_IO | __GFP_COMP;
908+
gfp_flags = __GFP_RECLAIM | __GFP_IO | __GFP_COMP;
909909

910910
egrcnt = dd->ipath_rcvegrcnt;
911911
/* TID number offset for this port */

fs/cachefiles/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extern unsigned cachefiles_debug;
3030
#define CACHEFILES_DEBUG_KLEAVE 2
3131
#define CACHEFILES_DEBUG_KDEBUG 4
3232

33-
#define cachefiles_gfp (__GFP_WAIT | __GFP_NORETRY | __GFP_NOMEMALLOC)
33+
#define cachefiles_gfp (__GFP_RECLAIM | __GFP_NORETRY | __GFP_NOMEMALLOC)
3434

3535
/*
3636
* node records

fs/direct-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ dio_bio_alloc(struct dio *dio, struct dio_submit *sdio,
361361

362362
/*
363363
* bio_alloc() is guaranteed to return a bio when called with
364-
* __GFP_WAIT and we request a valid number of vectors.
364+
* __GFP_RECLAIM and we request a valid number of vectors.
365365
*/
366366
bio = bio_alloc(GFP_KERNEL, nr_vecs);
367367

fs/nilfs2/mdt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static inline struct nilfs_mdt_info *NILFS_MDT(const struct inode *inode)
7272
}
7373

7474
/* Default GFP flags using highmem */
75-
#define NILFS_MDT_GFP (__GFP_WAIT | __GFP_IO | __GFP_HIGHMEM)
75+
#define NILFS_MDT_GFP (__GFP_RECLAIM | __GFP_IO | __GFP_HIGHMEM)
7676

7777
int nilfs_mdt_get_block(struct inode *, unsigned long, int,
7878
void (*init_block)(struct inode *,

include/linux/gfp.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ struct vm_area_struct;
107107
* can be cleared when the reclaiming of pages would cause unnecessary
108108
* disruption.
109109
*/
110-
#define __GFP_WAIT ((__force gfp_t)(___GFP_DIRECT_RECLAIM|___GFP_KSWAPD_RECLAIM))
110+
#define __GFP_RECLAIM ((__force gfp_t)(___GFP_DIRECT_RECLAIM|___GFP_KSWAPD_RECLAIM))
111111
#define __GFP_DIRECT_RECLAIM ((__force gfp_t)___GFP_DIRECT_RECLAIM) /* Caller can reclaim */
112112
#define __GFP_KSWAPD_RECLAIM ((__force gfp_t)___GFP_KSWAPD_RECLAIM) /* kswapd can wake */
113113

@@ -126,12 +126,12 @@ struct vm_area_struct;
126126
*/
127127
#define GFP_ATOMIC (__GFP_HIGH|__GFP_ATOMIC|__GFP_KSWAPD_RECLAIM)
128128
#define GFP_NOWAIT (__GFP_KSWAPD_RECLAIM)
129-
#define GFP_NOIO (__GFP_WAIT)
130-
#define GFP_NOFS (__GFP_WAIT | __GFP_IO)
131-
#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS)
132-
#define GFP_TEMPORARY (__GFP_WAIT | __GFP_IO | __GFP_FS | \
129+
#define GFP_NOIO (__GFP_RECLAIM)
130+
#define GFP_NOFS (__GFP_RECLAIM | __GFP_IO)
131+
#define GFP_KERNEL (__GFP_RECLAIM | __GFP_IO | __GFP_FS)
132+
#define GFP_TEMPORARY (__GFP_RECLAIM | __GFP_IO | __GFP_FS | \
133133
__GFP_RECLAIMABLE)
134-
#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
134+
#define GFP_USER (__GFP_RECLAIM | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
135135
#define GFP_HIGHUSER (GFP_USER | __GFP_HIGHMEM)
136136
#define GFP_HIGHUSER_MOVABLE (GFP_HIGHUSER | __GFP_MOVABLE)
137137
#define GFP_TRANSHUGE ((GFP_HIGHUSER_MOVABLE | __GFP_COMP | \
@@ -143,12 +143,12 @@ struct vm_area_struct;
143143
#define GFP_MOVABLE_SHIFT 3
144144

145145
/* Control page allocator reclaim behavior */
146-
#define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\
146+
#define GFP_RECLAIM_MASK (__GFP_RECLAIM|__GFP_HIGH|__GFP_IO|__GFP_FS|\
147147
__GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\
148148
__GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC)
149149

150150
/* Control slab gfp mask during early boot */
151-
#define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS))
151+
#define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_RECLAIM|__GFP_IO|__GFP_FS))
152152

153153
/* Control allocation constraints */
154154
#define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE)

0 commit comments

Comments
 (0)