Commit 903edea
mm: warn about illegal __GFP_NOFAIL usage in a more appropriate location and manner
Three points for this change:
1. We should consolidate all warnings in one place. Currently, the
order > 1 warning is in the hotpath, while others are in less
likely scenarios. Moving all warnings to the slowpath will reduce
the overhead for order > 1 and increase the visibility of other
warnings.
2. We currently have two warnings for order: one for order > 1 in
the hotpath and another for order > costly_order in the laziest
path. I suggest standardizing on order > 1 since it's been in
use for a long time.
3. We don't need to check for __GFP_NOWARN in this case. __GFP_NOWARN
is meant to suppress allocation failure reports, but here we're
dealing with bug detection, not allocation failures. So replace
WARN_ON_ONCE_GFP by WARN_ON_ONCE.
[v-songbaohua@oppo.com: also update the doc for __GFP_NOFAIL with order > 1]
Link: https://lkml.kernel.org/r/20240903223935.1697-1-21cnbao@gmail.com
Link: https://lkml.kernel.org/r/20240830202823.21478-4-21cnbao@gmail.com
Signed-off-by: Barry Song <v-songbaohua@oppo.com>
Suggested-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Christoph Lameter <cl@linux.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: David Rientjes <rientjes@google.com>
Cc: "Eugenio Pérez" <eperezma@redhat.com>
Cc: Hailong.Liu <hailong.liu@oppo.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Xie Yongji <xieyongji@bytedance.com>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>1 parent 17d7542 commit 903edea
2 files changed
+27
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
| 257 | + | |
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3032 | 3032 | | |
3033 | 3033 | | |
3034 | 3034 | | |
3035 | | - | |
3036 | | - | |
3037 | | - | |
3038 | | - | |
3039 | | - | |
3040 | | - | |
3041 | 3035 | | |
3042 | 3036 | | |
3043 | 3037 | | |
| |||
4175 | 4169 | | |
4176 | 4170 | | |
4177 | 4171 | | |
| 4172 | + | |
4178 | 4173 | | |
4179 | 4174 | | |
4180 | 4175 | | |
| |||
4187 | 4182 | | |
4188 | 4183 | | |
4189 | 4184 | | |
| 4185 | + | |
| 4186 | + | |
| 4187 | + | |
| 4188 | + | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
| 4193 | + | |
| 4194 | + | |
| 4195 | + | |
| 4196 | + | |
| 4197 | + | |
| 4198 | + | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
4190 | 4204 | | |
4191 | 4205 | | |
4192 | 4206 | | |
| |||
4404 | 4418 | | |
4405 | 4419 | | |
4406 | 4420 | | |
4407 | | - | |
| 4421 | + | |
4408 | 4422 | | |
4409 | | - | |
4410 | | - | |
| 4423 | + | |
| 4424 | + | |
| 4425 | + | |
4411 | 4426 | | |
4412 | | - | |
| 4427 | + | |
4413 | 4428 | | |
4414 | 4429 | | |
4415 | | - | |
4416 | | - | |
4417 | | - | |
4418 | | - | |
4419 | | - | |
4420 | | - | |
4421 | | - | |
4422 | | - | |
4423 | | - | |
4424 | | - | |
4425 | | - | |
4426 | | - | |
4427 | | - | |
4428 | | - | |
4429 | | - | |
4430 | 4430 | | |
4431 | 4431 | | |
4432 | 4432 | | |
| |||
0 commit comments