@@ -5070,7 +5070,7 @@ EXPORT_SYMBOL(__free_pages);
5070
5070
5071
5071
/*
5072
5072
* Can be called while holding raw_spin_lock or from IRQ and NMI for any
5073
- * page type (not only those that came from try_alloc_pages )
5073
+ * page type (not only those that came from alloc_pages_nolock )
5074
5074
*/
5075
5075
void free_pages_nolock (struct page * page , unsigned int order )
5076
5076
{
@@ -7311,20 +7311,21 @@ static bool __free_unaccepted(struct page *page)
7311
7311
#endif /* CONFIG_UNACCEPTED_MEMORY */
7312
7312
7313
7313
/**
7314
- * try_alloc_pages - opportunistic reentrant allocation from any context
7314
+ * alloc_pages_nolock - opportunistic reentrant allocation from any context
7315
7315
* @nid: node to allocate from
7316
7316
* @order: allocation order size
7317
7317
*
7318
7318
* Allocates pages of a given order from the given node. This is safe to
7319
7319
* call from any context (from atomic, NMI, and also reentrant
7320
- * allocator -> tracepoint -> try_alloc_pages_noprof ).
7320
+ * allocator -> tracepoint -> alloc_pages_nolock_noprof ).
7321
7321
* Allocation is best effort and to be expected to fail easily so nobody should
7322
7322
* rely on the success. Failures are not reported via warn_alloc().
7323
7323
* See always fail conditions below.
7324
7324
*
7325
- * Return: allocated page or NULL on failure.
7325
+ * Return: allocated page or NULL on failure. NULL does not mean EBUSY or EAGAIN.
7326
+ * It means ENOMEM. There is no reason to call it again and expect !NULL.
7326
7327
*/
7327
- struct page * try_alloc_pages_noprof (int nid , unsigned int order )
7328
+ struct page * alloc_pages_nolock_noprof (int nid , unsigned int order )
7328
7329
{
7329
7330
/*
7330
7331
* Do not specify __GFP_DIRECT_RECLAIM, since direct claim is not allowed.
@@ -7333,7 +7334,7 @@ struct page *try_alloc_pages_noprof(int nid, unsigned int order)
7333
7334
*
7334
7335
* These two are the conditions for gfpflags_allow_spinning() being true.
7335
7336
*
7336
- * Specify __GFP_NOWARN since failing try_alloc_pages () is not a reason
7337
+ * Specify __GFP_NOWARN since failing alloc_pages_nolock () is not a reason
7337
7338
* to warn. Also warn would trigger printk() which is unsafe from
7338
7339
* various contexts. We cannot use printk_deferred_enter() to mitigate,
7339
7340
* since the running context is unknown.
@@ -7343,7 +7344,7 @@ struct page *try_alloc_pages_noprof(int nid, unsigned int order)
7343
7344
* BPF use cases.
7344
7345
*
7345
7346
* Though __GFP_NOMEMALLOC is not checked in the code path below,
7346
- * specify it here to highlight that try_alloc_pages ()
7347
+ * specify it here to highlight that alloc_pages_nolock ()
7347
7348
* doesn't want to deplete reserves.
7348
7349
*/
7349
7350
gfp_t alloc_gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_NOMEMALLOC
0 commit comments