Skip to contentSkip to conversation

crypto/async_pq: use __free_page() instead of put_page()

PATCH In review Arnd Bergmann 5 participants 5 messages Feb 29, 2016 – Mar 4, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/async_pq: use __free_page() instead of put_page()

The addition of tracepoints to the page reference tracking had an unfortunate side-effect in at least one driver that calls put_page from its exit function, resulting in a link error:

.exit.text' referenced in section __jump_table' of crypto/built-in.o: defined in discarded section `.exit.text' of crypto/built-in.o

Quoted 1 line

From a cursory look at that this driver, it seems that it may be

doing the wrong thing here anyway, as the page gets allocated using 'alloc_page()', and should be freed using '__free_page()' rather than 'put_page()'.

With this patch, I no longer get any other build errors from the page_ref patch, so hopefully we can assume that it's always wrong to call any of those functions from __exit code, and that no other driver does it.

Fixes 0f80830dd044 ("mm/page_ref: add tracepoint to track down page reference manipulation")
---
 crypto/async_tx/async_pq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/async_tx/async_pq.c +1 -1
index c0748bbd4c08..08b3ac68952b 100644
@@ -444,7 +444,7 @@ static int __init async_pq_init(void)
 
 static void __exit async_pq_exit(void)
 {
-	put_page(pq_scribble_page);
+	__free_page(pq_scribble_page);
 }
 
 module_init(async_pq_init);
Signature · 1 line
2.7.0
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Arnd Bergmann

The addition of tracepoints to the page reference tracking had an unfortunate side-effect in at least one driver that calls put_page from its exit function, resulting in a link error:

.exit.text' referenced in section __jump_table' of crypto/built-in.o: defined in discarded section `.exit.text' of crypto/built-in.o

From a cursory look at that this driver, it seems that it may be doing the wrong thing here anyway, as the page gets allocated using 'alloc_page()', and should be freed using '__free_page()' rather than 'put_page()'.

Quoted 7 lines

With this patch, I no longer get any other build errors from the page_ref patch, so hopefully we can assume that it's always wrong to call any of those functions from __exit code, and that no other driver does it.

Fixes 0f80830dd044 ("mm/page_ref: add tracepoint to track down page reference manipulation")

Vinod, will you take this one?

#2 lore raw

2016-03-01 3:04 GMT+09:00 Dan Williams <[email protected]>:

Quoted 17 lines · Arnd Bergmann
Quoted 16 lines

The addition of tracepoints to the page reference tracking had an unfortunate side-effect in at least one driver that calls put_page from its exit function, resulting in a link error:

.exit.text' referenced in section __jump_table' of crypto/built-in.o: defined in discarded section `.exit.text' of crypto/built-in.o

From a cursory look at that this driver, it seems that it may be doing the wrong thing here anyway, as the page gets allocated using 'alloc_page()', and should be freed using '__free_page()' rather than 'put_page()'.

With this patch, I no longer get any other build errors from the page_ref patch, so hopefully we can assume that it's always wrong to call any of those functions from __exit code, and that no other driver does it.

Quoted 6 lines
Quoted 2 lines
Fixes 0f80830dd044 ("mm/page_ref: add tracepoint to track down page reference manipulation")

Vinod, will you take this one?

Problematic patch ("mm/page_ref: ~~~") is not yet merged one. It is on mmotm and this fix should go together with it or before it. I think that handling this fix by
Andrew is easier to all.

Thanks.

#3 lore raw
Quoted 21 lines · Joonsoo Kim

2016-03-01 3:04 GMT+09:00 Dan Williams <[email protected]>:

Quoted 20 lines · Arnd Bergmann
Quoted 18 lines

The addition of tracepoints to the page reference tracking had an unfortunate side-effect in at least one driver that calls put_page from its exit function, resulting in a link error:

.exit.text' referenced in section __jump_table' of crypto/built-in.o: defined in discarded section `.exit.text' of crypto/built-in.o

From a cursory look at that this driver, it seems that it may be doing the wrong thing here anyway, as the page gets allocated using 'alloc_page()', and should be freed using '__free_page()' rather than 'put_page()'.

With this patch, I no longer get any other build errors from the page_ref patch, so hopefully we can assume that it's always wrong to call any of those functions from __exit code, and that no other driver does it.

Fixes 0f80830dd044 ("mm/page_ref: add tracepoint to track down page reference manipulation")
Quoted 8 lines
Quoted 3 lines

Vinod, will you take this one?

Problematic patch ("mm/page_ref: ~~~") is not yet merged one. It is on mmotm and this fix should go together with it or before it. I think that handling this fix by
Andrew is easier to all.

Okay fine by me.

Signature · 7 lines
~Vinod

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Acked-by on v1 1/1
#4 lore raw
In reply to Arnd Bergmann
Quoted 11 lines · Arnd Bergmann

The addition of tracepoints to the page reference tracking had an unfortunate side-effect in at least one driver that calls put_page from its exit function, resulting in a link error:

.exit.text' referenced in section __jump_table' of crypto/built-in.o: defined in discarded section `.exit.text' of crypto/built-in.o

From a cursory look at that this driver, it seems that it may be doing the wrong thing here anyway, as the page gets allocated using 'alloc_page()', and should be freed using '__free_page()' rather than 'put_page()'.

Quoted 4 lines

With this patch, I no longer get any other build errors from the page_ref patch, so hopefully we can assume that it's always wrong to call any of those functions from __exit code, and that no other driver does it.

Hopefully that's true. If any such driver was leaking references to those pages, so the put_page() didn't actually result in freeing, the explicit __free_page should catch this via built-in checks.

Quoted 1 line
Fixes 0f80830dd044 ("mm/page_ref: add tracepoint to track down page reference manipulation")

Since it's in mmotm which is quilt-based, the commit hash from -next is not stable.

Quoted 1 line
Quoted 18 lines
---
 crypto/async_tx/async_pq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/async_tx/async_pq.c +1 -1
index c0748bbd4c08..08b3ac68952b 100644
@@ -444,7 +444,7 @@ static int __init async_pq_init(void)
 
 static void __exit async_pq_exit(void)
 {
-	put_page(pq_scribble_page);
+	__free_page(pq_scribble_page);
 }
 
 module_init(async_pq_init);