Skip to contentSkip to conversation

Documentation: memory - fix warning

PATCH Superseded Lothar Rubusch 3 participants 4 messages Apr 6, 2020 – Apr 7, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: memory - fix warning

The label in sphinx can refer to a document section but not to the document header.

The handle 'memory_allocation' is used in another document(s) to refer to GFP_KERNEL flags description in this modified document.

Since the sphinx label does not work as it is placed here, a proposal is to better shift it to the section about memory allocation flags.

---
 Documentation/core-api/memory-allocation.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/core-api/memory-allocation.rst +3 -2
index 4aa82ddd01b8..4d66ddcb9883 100644
@@ -1,5 +1,3 @@
-.. _memory_allocation:
-
 =======================
 Memory Allocation Guide
 =======================
@@ -26,6 +24,9 @@ answer, although very likely you should use
 Of course there are cases when other allocation APIs and different GFP
 flags must be used.
 
+
+.. _memory_allocation:
+
 Get Free Page flags
 ===================
 
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 10 lines · On Mon, 6 Apr 2020 22:07:43 +0000 Lothar Rubusch <[email protected]> wrote:

The label in sphinx can refer to a document section but not to the document header.

The handle 'memory_allocation' is used in another document(s) to refer to GFP_KERNEL flags description in this modified document.

Since the sphinx label does not work as it is placed here, a proposal is to better shift it to the section about memory allocation flags.

So I don't see any warnings associated with this label; what are you seeing and how are you getting it? Which version of Sphinx are you running?

Thanks,

jon

#2 lore raw
Quoted 10 lines · Jonathan Corbet
Quoted 6 lines · On Mon, 6 Apr 2020 22:07:43 +0000 Lothar Rubusch <[email protected]> wrote:

The label in sphinx can refer to a document section but not to the document header.

The handle 'memory_allocation' is used in another document(s) to refer to GFP_KERNEL flags description in this modified document.

Quoted 8 lines
Quoted 4 lines

Since the sphinx label does not work as it is placed here, a proposal is to better shift it to the section about memory allocation flags.

So I don't see any warnings associated with this label; what are you seeing and how are you getting it? Which version of Sphinx are you running?

My setup says "Running Sphinx v1.8.4". My sources are cloned from
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git from branch testing-staging
Am I doing this correctly?

I tried

$ git clean -fxd
$ make htmldocs
(...)
writing output... [ 16%] block/request .. crypto/api-akcipher
./include/linux/slab.h:503: WARNING: undefined label:
memory-allocation (if the link has no caption the label must precede a
section header)
writing output... [ 19%] crypto/api-digest .. driver-api/dmaengine/client
(...)

Alternatively, on plain console I see the following

$ make htmldocs
(...)
preparing documents... done
./include/linux/slab.h:503: WARNING: undefined label:
memory-allocation (if the link has no caption the label must precede a
section header)
/home/user/linux/Documentation/networking/devlink/devlink-trap.rst:302:
WARNING: undefined label: generic-packet-trap-groups (if the link has
no caption the label must precede a section header)
writing output... [100%] xtensa/mmu
waiting for workers...
(...)

Is this reproducible to you?

Honestly, I figured out my current patch fixes nothing. I see definitely a warning there,
but the problem is different:

A working referrer e.g. in Documentation/vm/index.rst:5 :ref:Documentation/core-api/memory-allocation.rst <memory_allocation>

The erronous referrer in /include/linux/slab.h:503 :ref:Documentation/core-api/memory-allocation.rst <memory-allocation>

Now this is really embarrassing! Can it be that I should rather have replaced the '-' by a '_'?

I would like to file a patch v2. Please rather consider the second patch, if this warning is reproducable to you guys.
I appologize for not having checked enough!

Best,
Lothar

reviewer
#3 lore raw
Quoted 56 lines · Lothar Rubusch
Quoted 10 lines · Jonathan Corbet
Quoted 6 lines · On Mon, 6 Apr 2020 22:07:43 +0000 Lothar Rubusch <[email protected]> wrote:

The label in sphinx can refer to a document section but not to the document header.

The handle 'memory_allocation' is used in another document(s) to refer to GFP_KERNEL flags description in this modified document.

Quoted 8 lines
Quoted 4 lines

Since the sphinx label does not work as it is placed here, a proposal is to better shift it to the section about memory allocation flags.

So I don't see any warnings associated with this label; what are you seeing and how are you getting it? Which version of Sphinx are you running?

My setup says "Running Sphinx v1.8.4". My sources are cloned from
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git from branch testing-staging
Am I doing this correctly?

I tried

$ git clean -fxd
$ make htmldocs
(...)
writing output... [ 16%] block/request .. crypto/api-akcipher
./include/linux/slab.h:503: WARNING: undefined label:
memory-allocation (if the link has no caption the label must precede a
section header)
writing output... [ 19%] crypto/api-digest .. driver-api/dmaengine/client
(...)

Alternatively, on plain console I see the following

$ make htmldocs
(...)
preparing documents... done
./include/linux/slab.h:503: WARNING: undefined label:
memory-allocation (if the link has no caption the label must precede a
section header)
/home/user/linux/Documentation/networking/devlink/devlink-trap.rst:302:
WARNING: undefined label: generic-packet-trap-groups (if the link has
no caption the label must precede a section header)
writing output... [100%] xtensa/mmu
waiting for workers...
(...)

Is this reproducible to you?

Honestly, I figured out my current patch fixes nothing. I see definitely a warning there,
but the problem is different:

Quoted 5 lines

A working referrer e.g. in Documentation/vm/index.rst:5 :ref:Documentation/core-api/memory-allocation.rst <memory_allocation>

The erronous referrer in /include/linux/slab.h:503 :ref:Documentation/core-api/memory-allocation.rst <memory-allocation>

Yes, I see that warning from slab.h.

Quoted 10 lines

Now this is really embarrassing! Can it be that I should rather have replaced the '-' by a '_'?

I would like to file a patch v2. Please rather consider the second patch, if this warning is reproducable to you guys.
I appologize for not having checked enough!

Best,
Lothar

Signature · 1 line
~Randy