diff mbox series

[-next] Documentation/vm: fix tables in arch_pgtable_helpers

Message ID 02ee60d0-e836-2237-4881-5c57ccac5551@infradead.org (mailing list archive)
State New, archived
Headers show
Series [-next] Documentation/vm: fix tables in arch_pgtable_helpers | expand

Commit Message

Randy Dunlap July 8, 2020, 1:07 a.m. UTC
From: Randy Dunlap <rdunlap@infradead.org>

Make the tables be presented as tables in the generated output files
(the line drawing did not present well).

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: linux-arch@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 Documentation/vm/arch_pgtable_helpers.rst |  333 ++++++--------------
 1 file changed, 116 insertions(+), 217 deletions(-)

Comments

Anshuman Khandual July 8, 2020, 1:22 a.m. UTC | #1
On 07/08/2020 06:37 AM, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Make the tables be presented as tables in the generated output files
> (the line drawing did not present well).
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: linux-doc@vger.kernel.org
> Cc: Anshuman Khandual <anshuman.khandual@arm.com>
> Cc: Mike Rapoport <rppt@kernel.org>
> Cc: linux-arch@vger.kernel.org
> Cc: linux-mm@kvack.org
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
>  Documentation/vm/arch_pgtable_helpers.rst |  333 ++++++--------------
>  1 file changed, 116 insertions(+), 217 deletions(-)

Do you have a git URL some where to see these new output ? This
documentation is also useful when reading from a terminal where
these manual line drawing tables make sense.
Randy Dunlap July 8, 2020, 2:06 a.m. UTC | #2
On 7/7/20 6:22 PM, Anshuman Khandual wrote:
> 
> 
> On 07/08/2020 06:37 AM, Randy Dunlap wrote:
>> From: Randy Dunlap <rdunlap@infradead.org>
>>
>> Make the tables be presented as tables in the generated output files
>> (the line drawing did not present well).
>>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Jonathan Corbet <corbet@lwn.net>
>> Cc: linux-doc@vger.kernel.org
>> Cc: Anshuman Khandual <anshuman.khandual@arm.com>
>> Cc: Mike Rapoport <rppt@kernel.org>
>> Cc: linux-arch@vger.kernel.org
>> Cc: linux-mm@kvack.org
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> ---
>>  Documentation/vm/arch_pgtable_helpers.rst |  333 ++++++--------------
>>  1 file changed, 116 insertions(+), 217 deletions(-)
> 
> Do you have a git URL some where to see these new output ? This
> documentation is also useful when reading from a terminal where
> these manual line drawing tables make sense.
> 

No, I don't have a git URL.
You can go to
https://drive.google.com/file/d/1FO6lCRKldzESwLdylvY8tw10dOBvwz84/view?usp=sharing

I had to Download the file and then view it locally. I couldn't get Google Drive
to display it for me as html (only as text).

I understand about reading tables at a terminal.
This file could have been a txt file for that, but it's not. It's a RsT file.

If you want to leave it as is, please fix these warnings:

Documentation/vm/arch_pgtable_helpers.rst:24: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:28: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:32: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:36: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:40: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:44: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:48: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:52: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:56: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:60: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:64: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:68: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:72: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:76: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:88: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:92: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:96: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:100: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:104: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:108: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:112: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:116: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:120: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:124: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:128: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:132: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:136: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:140: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:144: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:148: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:152: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:162: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:166: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:170: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:174: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:178: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:182: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:186: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:190: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:194: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:198: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:202: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:206: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:218: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:222: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:226: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:230: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:234: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:244: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:248: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:252: WARNING: Line block ends without a blank line.
Documentation/vm/arch_pgtable_helpers.rst:256: WARNING: Line block ends without a blank line.


thanks.
Anshuman Khandual July 8, 2020, 5:09 a.m. UTC | #3
On 07/08/2020 07:36 AM, Randy Dunlap wrote:
> On 7/7/20 6:22 PM, Anshuman Khandual wrote:
>>
>>
>> On 07/08/2020 06:37 AM, Randy Dunlap wrote:
>>> From: Randy Dunlap <rdunlap@infradead.org>
>>>
>>> Make the tables be presented as tables in the generated output files
>>> (the line drawing did not present well).
>>>
>>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>> Cc: linux-doc@vger.kernel.org
>>> Cc: Anshuman Khandual <anshuman.khandual@arm.com>
>>> Cc: Mike Rapoport <rppt@kernel.org>
>>> Cc: linux-arch@vger.kernel.org
>>> Cc: linux-mm@kvack.org
>>> Cc: Andrew Morton <akpm@linux-foundation.org>
>>> ---
>>>  Documentation/vm/arch_pgtable_helpers.rst |  333 ++++++--------------
>>>  1 file changed, 116 insertions(+), 217 deletions(-)
>>
>> Do you have a git URL some where to see these new output ? This
>> documentation is also useful when reading from a terminal where
>> these manual line drawing tables make sense.
>>
> 
> No, I don't have a git URL.
> You can go to
> https://drive.google.com/file/d/1FO6lCRKldzESwLdylvY8tw10dOBvwz84/view?usp=sharing
> 
> I had to Download the file and then view it locally. I couldn't get Google Drive
> to display it for me as html (only as text).

I could see it locally as well on a browser and the table looks the same
way like those current manual ones on a terminal, so looks good to me.

> 
> I understand about reading tables at a terminal.
> This file could have been a txt file for that, but it's not. It's a RsT file.

Thats right. All files in Documentation/vm/ are .rst type, hence would
not like to have a .txt type in there.

> 
> If you want to leave it as is, please fix these warnings:

Thats right. Can not have in both ways. Lets stick with .rst and change
as required.
Anshuman Khandual July 8, 2020, 6:40 a.m. UTC | #4
On 07/08/2020 06:37 AM, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Make the tables be presented as tables in the generated output files
> (the line drawing did not present well).
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: linux-doc@vger.kernel.org
> Cc: Anshuman Khandual <anshuman.khandual@arm.com>
> Cc: Mike Rapoport <rppt@kernel.org>
> Cc: linux-arch@vger.kernel.org
> Cc: linux-mm@kvack.org
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
>  Documentation/vm/arch_pgtable_helpers.rst |  333 ++++++--------------
>  1 file changed, 116 insertions(+), 217 deletions(-)
> 
> --- linux-next-20200707.orig/Documentation/vm/arch_pgtable_helpers.rst
> +++ linux-next-20200707/Documentation/vm/arch_pgtable_helpers.rst
> @@ -17,242 +17,141 @@ test need to be in sync.
>  PTE Page Table Helpers
>  ======================
>  
> ---------------------------------------------------------------------------------
> -| pte_same                  | Tests whether both PTE entries are the same      |
> ---------------------------------------------------------------------------------
> -| pte_bad                   | Tests a non-table mapped PTE                     |
> ---------------------------------------------------------------------------------
> -| pte_present               | Tests a valid mapped PTE                         |
> ---------------------------------------------------------------------------------
> -| pte_young                 | Tests a young PTE                                |
> ---------------------------------------------------------------------------------
> -| pte_dirty                 | Tests a dirty PTE                                |
> ---------------------------------------------------------------------------------
> -| pte_write                 | Tests a writable PTE                             |
> ---------------------------------------------------------------------------------
> -| pte_special               | Tests a special PTE                              |
> ---------------------------------------------------------------------------------
> -| pte_protnone              | Tests a PROT_NONE PTE                            |
> ---------------------------------------------------------------------------------
> -| pte_devmap                | Tests a ZONE_DEVICE mapped PTE                   |
> ---------------------------------------------------------------------------------
> -| pte_soft_dirty            | Tests a soft dirty PTE                           |
> ---------------------------------------------------------------------------------
> -| pte_swp_soft_dirty        | Tests a soft dirty swapped PTE                   |
> ---------------------------------------------------------------------------------
> -| pte_mkyoung               | Creates a young PTE                              |
> ---------------------------------------------------------------------------------
> -| pte_mkold                 | Creates an old PTE                               |
> ---------------------------------------------------------------------------------
> -| pte_mkdirty               | Creates a dirty PTE                              |
> ---------------------------------------------------------------------------------
> -| pte_mkclean               | Creates a clean PTE                              |
> ---------------------------------------------------------------------------------
> -| pte_mkwrite               | Creates a writable PTE                           |
> ---------------------------------------------------------------------------------
> -| pte_mkwrprotect           | Creates a write protected PTE                    |
> ---------------------------------------------------------------------------------
> -| pte_mkspecial             | Creates a special PTE                            |
> ---------------------------------------------------------------------------------
> -| pte_mkdevmap              | Creates a ZONE_DEVICE mapped PTE                 |
> ---------------------------------------------------------------------------------
> -| pte_mksoft_dirty          | Creates a soft dirty PTE                         |
> ---------------------------------------------------------------------------------
> -| pte_clear_soft_dirty      | Clears a soft dirty PTE                          |
> ---------------------------------------------------------------------------------
> -| pte_swp_mksoft_dirty      | Creates a soft dirty swapped PTE                 |
> ---------------------------------------------------------------------------------
> -| pte_swp_clear_soft_dirty  | Clears a soft dirty swapped PTE                  |
> ---------------------------------------------------------------------------------
> -| pte_mknotpresent          | Invalidates a mapped PTE                         |
> ---------------------------------------------------------------------------------
> -| ptep_get_and_clear        | Clears a PTE                                     |
> ---------------------------------------------------------------------------------
> -| ptep_get_and_clear_full   | Clears a PTE                                     |
> ---------------------------------------------------------------------------------
> -| ptep_test_and_clear_young | Clears young from a PTE                          |
> ---------------------------------------------------------------------------------
> -| ptep_set_wrprotect        | Converts into a write protected PTE              |
> ---------------------------------------------------------------------------------
> -| ptep_set_access_flags     | Converts into a more permissive PTE              |
> ---------------------------------------------------------------------------------
> +===========================   ================================================
> +pte_same                      Tests whether both PTE entries are the same
> +pte_bad                       Tests a non-table mapped PTE
> +pte_present                   Tests a valid mapped PTE
> +pte_young                     Tests a young PTE
> +pte_dirty                     Tests a dirty PTE
> +pte_write                     Tests a writable PTE
> +pte_special                   Tests a special PTE
> +pte_protnone                  Tests a PROT_NONE PTE
> +pte_devmap                    Tests a ZONE_DEVICE mapped PTE
> +pte_soft_dirty                Tests a soft dirty PTE
> +pte_swp_soft_dirty            Tests a soft dirty swapped PTE
> +pte_mkyoung                   Creates a young PTE
> +pte_mkold                     Creates an old PTE
> +pte_mkdirty                   Creates a dirty PTE
> +pte_mkclean                   Creates a clean PTE
> +pte_mkwrite                   Creates a writable PTE
> +pte_mkwrprotect               Creates a write protected PTE
> +pte_mkspecial                 Creates a special PTE
> +pte_mkdevmap                  Creates a ZONE_DEVICE mapped PTE
> +pte_mksoft_dirty              Creates a soft dirty PTE
> +pte_clear_soft_dirty          Clears a soft dirty PTE
> +pte_swp_mksoft_dirty          Creates a soft dirty swapped PTE
> +pte_swp_clear_soft_dirty      Clears a soft dirty swapped PTE
> +pte_mknotpresent              Invalidates a mapped PTE
> +ptep_get_and_clear            Clears a PTE
> +ptep_get_and_clear_full       Clears a PTE
> +ptep_test_and_clear_young     Clears young from a PTE
> +ptep_set_wrprotect            Converts into a write protected PTE
> +ptep_set_access_flags         Converts into a more permissive PTE
> +===========================   ================================================
>  
>  ======================
>  PMD Page Table Helpers
>  ======================
>  
> ---------------------------------------------------------------------------------
> -| pmd_same                  | Tests whether both PMD entries are the same      |
> ---------------------------------------------------------------------------------
> -| pmd_bad                   | Tests a non-table mapped PMD                     |
> ---------------------------------------------------------------------------------
> -| pmd_leaf                  | Tests a leaf mapped PMD                          |
> ---------------------------------------------------------------------------------
> -| pmd_huge                  | Tests a HugeTLB mapped PMD                       |
> ---------------------------------------------------------------------------------
> -| pmd_trans_huge            | Tests a Transparent Huge Page (THP) at PMD       |
> ---------------------------------------------------------------------------------
> -| pmd_present               | Tests a valid mapped PMD                         |
> ---------------------------------------------------------------------------------
> -| pmd_young                 | Tests a young PMD                                |
> ---------------------------------------------------------------------------------
> -| pmd_dirty                 | Tests a dirty PMD                                |
> ---------------------------------------------------------------------------------
> -| pmd_write                 | Tests a writable PMD                             |
> ---------------------------------------------------------------------------------
> -| pmd_special               | Tests a special PMD                              |
> ---------------------------------------------------------------------------------
> -| pmd_protnone              | Tests a PROT_NONE PMD                            |
> ---------------------------------------------------------------------------------
> -| pmd_devmap                | Tests a ZONE_DEVICE mapped PMD                   |
> ---------------------------------------------------------------------------------
> -| pmd_soft_dirty            | Tests a soft dirty PMD                           |
> ---------------------------------------------------------------------------------
> -| pmd_swp_soft_dirty        | Tests a soft dirty swapped PMD                   |
> ---------------------------------------------------------------------------------
> -| pmd_mkyoung               | Creates a young PMD                              |
> ---------------------------------------------------------------------------------
> -| pmd_mkold                 | Creates an old PMD                               |
> ---------------------------------------------------------------------------------
> -| pmd_mkdirty               | Creates a dirty PMD                              |
> ---------------------------------------------------------------------------------
> -| pmd_mkclean               | Creates a clean PMD                              |
> ---------------------------------------------------------------------------------
> -| pmd_mkwrite               | Creates a writable PMD                           |
> ---------------------------------------------------------------------------------
> -| pmd_mkwrprotect           | Creates a write protected PMD                    |
> ---------------------------------------------------------------------------------
> -| pmd_mkspecial             | Creates a special PMD                            |
> ---------------------------------------------------------------------------------
> -| pmd_mkdevmap              | Creates a ZONE_DEVICE mapped PMD                 |
> ---------------------------------------------------------------------------------
> -| pmd_mksoft_dirty          | Creates a soft dirty PMD                         |
> ---------------------------------------------------------------------------------
> -| pmd_clear_soft_dirty      | Clears a soft dirty PMD                          |
> ---------------------------------------------------------------------------------
> -| pmd_swp_mksoft_dirty      | Creates a soft dirty swapped PMD                 |
> ---------------------------------------------------------------------------------
> -| pmd_swp_clear_soft_dirty  | Clears a soft dirty swapped PMD                  |
> ---------------------------------------------------------------------------------
> -| pmd_mkinvalid             | Invalidates a mapped PMD [1]                     |
> ---------------------------------------------------------------------------------
> -| pmd_set_huge              | Creates a PMD huge mapping                       |
> ---------------------------------------------------------------------------------
> -| pmd_clear_huge            | Clears a PMD huge mapping                        |
> ---------------------------------------------------------------------------------
> -| pmdp_get_and_clear        | Clears a PMD                                     |
> ---------------------------------------------------------------------------------
> -| pmdp_get_and_clear_full   | Clears a PMD                                     |
> ---------------------------------------------------------------------------------
> -| pmdp_test_and_clear_young | Clears young from a PMD                          |
> ---------------------------------------------------------------------------------
> -| pmdp_set_wrprotect        | Converts into a write protected PMD              |
> ---------------------------------------------------------------------------------
> -| pmdp_set_access_flags     | Converts into a more permissive PMD              |
> ---------------------------------------------------------------------------------
> +===========================   ================================================
> +pmd_same                      Tests whether both PMD entries are the same
> +pmd_bad                       Tests a non-table mapped PMD
> +pmd_leaf                      Tests a leaf mapped PMD
> +pmd_huge                      Tests a HugeTLB mapped PMD
> +pmd_trans_huge                Tests a Transparent Huge Page (THP) at PMD
> +pmd_present                   Tests a valid mapped PMD
> +pmd_young                     Tests a young PMD
> +pmd_dirty                     Tests a dirty PMD
> +pmd_write                     Tests a writable PMD
> +pmd_special                   Tests a special PMD
> +pmd_protnone                  Tests a PROT_NONE PMD
> +pmd_devmap                    Tests a ZONE_DEVICE mapped PMD
> +pmd_soft_dirty                Tests a soft dirty PMD
> +pmd_swp_soft_dirty            Tests a soft dirty swapped PMD
> +pmd_mkyoung                   Creates a young PMD
> +pmd_mkold                     Creates an old PMD
> +pmd_mkdirty                   Creates a dirty PMD
> +pmd_mkclean                   Creates a clean PMD
> +pmd_mkwrite                   Creates a writable PMD
> +pmd_mkwrprotect               Creates a write protected PMD
> +pmd_mkspecial                 Creates a special PMD
> +pmd_mkdevmap                  Creates a ZONE_DEVICE mapped PMD
> +pmd_mksoft_dirty              Creates a soft dirty PMD
> +pmd_clear_soft_dirty          Clears a soft dirty PMD
> +pmd_swp_mksoft_dirty          Creates a soft dirty swapped PMD
> +pmd_swp_clear_soft_dirty      Clears a soft dirty swapped PMD
> +pmd_mkinvalid                 Invalidates a mapped PMD [1]
> +pmd_set_huge                  Creates a PMD huge mapping
> +pmd_clear_huge                Clears a PMD huge mapping
> +pmdp_get_and_clear            Clears a PMD
> +pmdp_get_and_clear_full       Clears a PMD
> +pmdp_test_and_clear_young     Clears young from a PMD
> +pmdp_set_wrprotect            Converts into a write protected PMD
> +pmdp_set_access_flags         Converts into a more permissive PMD
> +===========================   ================================================
>  
>  ======================
>  PUD Page Table Helpers
>  ======================
>  
> ---------------------------------------------------------------------------------
> -| pud_same                  | Tests whether both PUD entries are the same      |
> ---------------------------------------------------------------------------------
> -| pud_bad                   | Tests a non-table mapped PUD                     |
> ---------------------------------------------------------------------------------
> -| pud_leaf                  | Tests a leaf mapped PUD                          |
> ---------------------------------------------------------------------------------
> -| pud_huge                  | Tests a HugeTLB mapped PUD                       |
> ---------------------------------------------------------------------------------
> -| pud_trans_huge            | Tests a Transparent Huge Page (THP) at PUD       |
> ---------------------------------------------------------------------------------
> -| pud_present               | Tests a valid mapped PUD                         |
> ---------------------------------------------------------------------------------
> -| pud_young                 | Tests a young PUD                                |
> ---------------------------------------------------------------------------------
> -| pud_dirty                 | Tests a dirty PUD                                |
> ---------------------------------------------------------------------------------
> -| pud_write                 | Tests a writable PUD                             |
> ---------------------------------------------------------------------------------
> -| pud_devmap                | Tests a ZONE_DEVICE mapped PUD                   |
> ---------------------------------------------------------------------------------
> -| pud_mkyoung               | Creates a young PUD                              |
> ---------------------------------------------------------------------------------
> -| pud_mkold                 | Creates an old PUD                               |
> ---------------------------------------------------------------------------------
> -| pud_mkdirty               | Creates a dirty PUD                              |
> ---------------------------------------------------------------------------------
> -| pud_mkclean               | Creates a clean PUD                              |
> ---------------------------------------------------------------------------------
> -| pud_mkwrite               | Creates a writable PMD                           |
> ---------------------------------------------------------------------------------
> -| pud_mkwrprotect           | Creates a write protected PMD                    |
> ---------------------------------------------------------------------------------
> -| pud_mkdevmap              | Creates a ZONE_DEVICE mapped PMD                 |
> ---------------------------------------------------------------------------------
> -| pud_mkinvalid             | Invalidates a mapped PUD [1]                     |
> ---------------------------------------------------------------------------------
> -| pud_set_huge              | Creates a PUD huge mapping                       |
> ---------------------------------------------------------------------------------
> -| pud_clear_huge            | Clears a PUD huge mapping                        |
> ---------------------------------------------------------------------------------
> -| pudp_get_and_clear        | Clears a PUD                                     |
> ---------------------------------------------------------------------------------
> -| pudp_get_and_clear_full   | Clears a PUD                                     |
> ---------------------------------------------------------------------------------
> -| pudp_test_and_clear_young | Clears young from a PUD                          |
> ---------------------------------------------------------------------------------
> -| pudp_set_wrprotect        | Converts into a write protected PUD              |
> ---------------------------------------------------------------------------------
> -| pudp_set_access_flags     | Converts into a more permissive PUD              |
> ---------------------------------------------------------------------------------
> +===========================   ================================================
> +pud_same                      Tests whether both PUD entries are the same
> +pud_bad                       Tests a non-table mapped PUD
> +pud_leaf                      Tests a leaf mapped PUD
> +pud_huge                      Tests a HugeTLB mapped PUD
> +pud_trans_huge                Tests a Transparent Huge Page (THP) at PUD
> +pud_present                   Tests a valid mapped PUD
> +pud_young                     Tests a young PUD
> +pud_dirty                     Tests a dirty PUD
> +pud_write                     Tests a writable PUD
> +pud_devmap                    Tests a ZONE_DEVICE mapped PUD
> +pud_mkyoung                   Creates a young PUD
> +pud_mkold                     Creates an old PUD
> +pud_mkdirty                   Creates a dirty PUD
> +pud_mkclean                   Creates a clean PUD

> +pud_mkwrite                   Creates a writable PMD
> +pud_mkwrprotect               Creates a write protected PMD
> +pud_mkdevmap                  Creates a ZONE_DEVICE mapped PMD

Three lines above should be change as s/PMD/PUD/. These typos are
present from the original patch.

> +pud_mkinvalid                 Invalidates a mapped PUD [1]
> +pud_set_huge                  Creates a PUD huge mapping
> +pud_clear_huge                Clears a PUD huge mapping
> +pudp_get_and_clear            Clears a PUD
> +pudp_get_and_clear_full       Clears a PUD
> +pudp_test_and_clear_young     Clears young from a PUD
> +pudp_set_wrprotect            Converts into a write protected PUD
> +pudp_set_access_flags         Converts into a more permissive PUD
> +===========================   ================================================
>  
>  ==========================
>  HugeTLB Page Table Helpers
>  ==========================
>  
> ---------------------------------------------------------------------------------
> -| pte_huge                  | Tests a HugeTLB                                  |
> ---------------------------------------------------------------------------------
> -| pte_mkhuge                | Creates a HugeTLB                                |
> ---------------------------------------------------------------------------------
> -| huge_pte_dirty            | Tests a dirty HugeTLB                            |
> ---------------------------------------------------------------------------------
> -| huge_pte_write            | Tests a writable HugeTLB                         |
> ---------------------------------------------------------------------------------
> -| huge_pte_mkdirty          | Creates a dirty HugeTLB                          |
> ---------------------------------------------------------------------------------
> -| huge_pte_mkwrite          | Creates a writable HugeTLB                       |
> ---------------------------------------------------------------------------------
> -| huge_pte_mkwrprotect      | Creates a write protected HugeTLB                |
> ---------------------------------------------------------------------------------
> -| huge_ptep_get_and_clear   | Clears a HugeTLB                                 |
> ---------------------------------------------------------------------------------
> -| huge_ptep_set_wrprotect   | Converts into a write protected HugeTLB          |
> ---------------------------------------------------------------------------------
> -| huge_ptep_set_access_flags  | Converts into a more permissive HugeTLB        |
> ---------------------------------------------------------------------------------
> +============================   ===============================================
> +pte_huge                       Tests a HugeTLB
> +pte_mkhuge                     Creates a HugeTLB
> +huge_pte_dirty                 Tests a dirty HugeTLB
> +huge_pte_write                 Tests a writable HugeTLB
> +huge_pte_mkdirty               Creates a dirty HugeTLB
> +huge_pte_mkwrite               Creates a writable HugeTLB
> +huge_pte_mkwrprotect           Creates a write protected HugeTLB
> +huge_ptep_get_and_clear        Clears a HugeTLB
> +huge_ptep_set_wrprotect        Converts into a write protected HugeTLB
> +huge_ptep_set_access_flags     Converts into a more permissive HugeTLB
> +============================   ===============================================
>  
>  ========================
>  SWAP Page Table Helpers
>  ========================
>  
> ---------------------------------------------------------------------------------
> -| __pte_to_swp_entry        | Creates a swapped entry (arch) from a mapepd PTE |
> ---------------------------------------------------------------------------------
> -| __swp_to_pte_entry        | Creates a mapped PTE from a swapped entry (arch) |
> ---------------------------------------------------------------------------------
> -| __pmd_to_swp_entry        | Creates a swapped entry (arch) from a mapepd PMD |
> ---------------------------------------------------------------------------------

s/mapepd/mapped.                                                        ^^^^^^^^^^

> -| __swp_to_pmd_entry        | Creates a mapped PMD from a swapped entry (arch) |
> ---------------------------------------------------------------------------------
> -| is_migration_entry        | Tests a migration (read or write) swapped entry  |
> ---------------------------------------------------------------------------------
> -| is_write_migration_entry  | Tests a write migration swapped entry            |
> ---------------------------------------------------------------------------------
> -| make_migration_entry_read | Converts into read migration swapped entry       |
> ---------------------------------------------------------------------------------
> -| make_migration_entry      | Creates a migration swapped entry (read or write)|
> ---------------------------------------------------------------------------------
> +==========================  =================================================
> +__pte_to_swp_entry          Creates a swapped entry (arch) from a mapepd PTE
> +__swp_to_pte_entry          Creates a mapped PTE from a swapped entry (arch)
> +__pmd_to_swp_entry          Creates a swapped entry (arch) from a mapepd PMD

Couple of original typos here as well - s/mapepd/mapped.             ^^^^^^^

> +__swp_to_pmd_entry          Creates a mapped PMD from a swapped entry (arch)
> +is_migration_entry          Tests a migration (read or write) swapped entry
> +is_write_migration_entry    Tests a write migration swapped entry
> +make_migration_entry_read   Converts into read migration swapped entry
> +make_migration_entry        Creates a migration swapped entry (read or write)
> +==========================  =================================================
>  
>  [1] https://lore.kernel.org/linux-mm/20181017020930.GN30832@redhat.com/

As this requires some typo fixes coming from the original patch, I could fold these
changes while adding your Signed-off-by: for relevant section and respin the series.
Please suggest.
Mike Rapoport July 8, 2020, 6:43 a.m. UTC | #5
Hi Randy,

On Tue, Jul 07, 2020 at 06:07:40PM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Make the tables be presented as tables in the generated output files
> (the line drawing did not present well).
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: linux-doc@vger.kernel.org
> Cc: Anshuman Khandual <anshuman.khandual@arm.com>
> Cc: Mike Rapoport <rppt@kernel.org>
> Cc: linux-arch@vger.kernel.org
> Cc: linux-mm@kvack.org
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
>  Documentation/vm/arch_pgtable_helpers.rst |  333 ++++++--------------
>  1 file changed, 116 insertions(+), 217 deletions(-)
> 
> --- linux-next-20200707.orig/Documentation/vm/arch_pgtable_helpers.rst
> +++ linux-next-20200707/Documentation/vm/arch_pgtable_helpers.rst
> @@ -17,242 +17,141 @@ test need to be in sync.
>  PTE Page Table Helpers
>  ======================
>  
> ---------------------------------------------------------------------------------
> -| pte_same                  | Tests whether both PTE entries are the same      |
> ---------------------------------------------------------------------------------

According to ReST docs [1] we can use +---+---+ as row delimiter and
than we can keep | as column delimiter.

@Andrew, can you please fold the below patch into Anshuman's original
patch?

[1] https://docutils.sourceforge.io/docs/user/rst/quickref.html#tables

diff --git a/Documentation/vm/arch_pgtable_helpers.rst b/Documentation/vm/arch_pgtable_helpers.rst
index cd7609b05446..b106a1e9ef30 100644
--- a/Documentation/vm/arch_pgtable_helpers.rst
+++ b/Documentation/vm/arch_pgtable_helpers.rst
@@ -17,242 +17,242 @@ test need to be in sync.
 PTE Page Table Helpers
 ======================
 
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_same                  | Tests whether both PTE entries are the same      |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_bad                   | Tests a non-table mapped PTE                     |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_present               | Tests a valid mapped PTE                         |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_young                 | Tests a young PTE                                |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_dirty                 | Tests a dirty PTE                                |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_write                 | Tests a writable PTE                             |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_special               | Tests a special PTE                              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_protnone              | Tests a PROT_NONE PTE                            |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_devmap                | Tests a ZONE_DEVICE mapped PTE                   |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_soft_dirty            | Tests a soft dirty PTE                           |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_swp_soft_dirty        | Tests a soft dirty swapped PTE                   |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_mkyoung               | Creates a young PTE                              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_mkold                 | Creates an old PTE                               |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_mkdirty               | Creates a dirty PTE                              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_mkclean               | Creates a clean PTE                              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_mkwrite               | Creates a writable PTE                           |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_mkwrprotect           | Creates a write protected PTE                    |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_mkspecial             | Creates a special PTE                            |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_mkdevmap              | Creates a ZONE_DEVICE mapped PTE                 |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_mksoft_dirty          | Creates a soft dirty PTE                         |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_clear_soft_dirty      | Clears a soft dirty PTE                          |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_swp_mksoft_dirty      | Creates a soft dirty swapped PTE                 |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_swp_clear_soft_dirty  | Clears a soft dirty swapped PTE                  |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_mknotpresent          | Invalidates a mapped PTE                         |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | ptep_get_and_clear        | Clears a PTE                                     |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | ptep_get_and_clear_full   | Clears a PTE                                     |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | ptep_test_and_clear_young | Clears young from a PTE                          |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | ptep_set_wrprotect        | Converts into a write protected PTE              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | ptep_set_access_flags     | Converts into a more permissive PTE              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 
 ======================
 PMD Page Table Helpers
 ======================
 
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_same                  | Tests whether both PMD entries are the same      |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_bad                   | Tests a non-table mapped PMD                     |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_leaf                  | Tests a leaf mapped PMD                          |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_huge                  | Tests a HugeTLB mapped PMD                       |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_trans_huge            | Tests a Transparent Huge Page (THP) at PMD       |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_present               | Tests a valid mapped PMD                         |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_young                 | Tests a young PMD                                |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_dirty                 | Tests a dirty PMD                                |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_write                 | Tests a writable PMD                             |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_special               | Tests a special PMD                              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_protnone              | Tests a PROT_NONE PMD                            |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_devmap                | Tests a ZONE_DEVICE mapped PMD                   |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_soft_dirty            | Tests a soft dirty PMD                           |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_swp_soft_dirty        | Tests a soft dirty swapped PMD                   |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_mkyoung               | Creates a young PMD                              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_mkold                 | Creates an old PMD                               |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_mkdirty               | Creates a dirty PMD                              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_mkclean               | Creates a clean PMD                              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_mkwrite               | Creates a writable PMD                           |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_mkwrprotect           | Creates a write protected PMD                    |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_mkspecial             | Creates a special PMD                            |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_mkdevmap              | Creates a ZONE_DEVICE mapped PMD                 |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_mksoft_dirty          | Creates a soft dirty PMD                         |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_clear_soft_dirty      | Clears a soft dirty PMD                          |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_swp_mksoft_dirty      | Creates a soft dirty swapped PMD                 |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_swp_clear_soft_dirty  | Clears a soft dirty swapped PMD                  |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_mkinvalid             | Invalidates a mapped PMD [1]                     |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_set_huge              | Creates a PMD huge mapping                       |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmd_clear_huge            | Clears a PMD huge mapping                        |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmdp_get_and_clear        | Clears a PMD                                     |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmdp_get_and_clear_full   | Clears a PMD                                     |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmdp_test_and_clear_young | Clears young from a PMD                          |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmdp_set_wrprotect        | Converts into a write protected PMD              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pmdp_set_access_flags     | Converts into a more permissive PMD              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 
 ======================
 PUD Page Table Helpers
 ======================
 
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_same                  | Tests whether both PUD entries are the same      |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_bad                   | Tests a non-table mapped PUD                     |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_leaf                  | Tests a leaf mapped PUD                          |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_huge                  | Tests a HugeTLB mapped PUD                       |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_trans_huge            | Tests a Transparent Huge Page (THP) at PUD       |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_present               | Tests a valid mapped PUD                         |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_young                 | Tests a young PUD                                |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_dirty                 | Tests a dirty PUD                                |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_write                 | Tests a writable PUD                             |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_devmap                | Tests a ZONE_DEVICE mapped PUD                   |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_mkyoung               | Creates a young PUD                              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_mkold                 | Creates an old PUD                               |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_mkdirty               | Creates a dirty PUD                              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_mkclean               | Creates a clean PUD                              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_mkwrite               | Creates a writable PMD                           |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_mkwrprotect           | Creates a write protected PMD                    |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_mkdevmap              | Creates a ZONE_DEVICE mapped PMD                 |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_mkinvalid             | Invalidates a mapped PUD [1]                     |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_set_huge              | Creates a PUD huge mapping                       |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pud_clear_huge            | Clears a PUD huge mapping                        |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pudp_get_and_clear        | Clears a PUD                                     |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pudp_get_and_clear_full   | Clears a PUD                                     |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pudp_test_and_clear_young | Clears young from a PUD                          |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pudp_set_wrprotect        | Converts into a write protected PUD              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pudp_set_access_flags     | Converts into a more permissive PUD              |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 
 ==========================
 HugeTLB Page Table Helpers
 ==========================
 
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_huge                  | Tests a HugeTLB                                  |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | pte_mkhuge                | Creates a HugeTLB                                |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | huge_pte_dirty            | Tests a dirty HugeTLB                            |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | huge_pte_write            | Tests a writable HugeTLB                         |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | huge_pte_mkdirty          | Creates a dirty HugeTLB                          |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | huge_pte_mkwrite          | Creates a writable HugeTLB                       |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | huge_pte_mkwrprotect      | Creates a write protected HugeTLB                |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | huge_ptep_get_and_clear   | Clears a HugeTLB                                 |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | huge_ptep_set_wrprotect   | Converts into a write protected HugeTLB          |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | huge_ptep_set_access_flags  | Converts into a more permissive HugeTLB        |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 
 ========================
 SWAP Page Table Helpers
 ========================
 
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | __pte_to_swp_entry        | Creates a swapped entry (arch) from a mapepd PTE |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | __swp_to_pte_entry        | Creates a mapped PTE from a swapped entry (arch) |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | __pmd_to_swp_entry        | Creates a swapped entry (arch) from a mapepd PMD |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | __swp_to_pmd_entry        | Creates a mapped PMD from a swapped entry (arch) |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | is_migration_entry        | Tests a migration (read or write) swapped entry  |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | is_write_migration_entry  | Tests a write migration swapped entry            |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | make_migration_entry_read | Converts into read migration swapped entry       |
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 | make_migration_entry      | Creates a migration swapped entry (read or write)|
---------------------------------------------------------------------------------
++---------------------------+--------------------------------------------------+
 
 [1] https://lore.kernel.org/linux-mm/20181017020930.GN30832@redhat.com/
Randy Dunlap July 8, 2020, 1:21 p.m. UTC | #6
On 7/7/20 11:43 PM, Mike Rapoport wrote:
> Hi Randy,
> 
> On Tue, Jul 07, 2020 at 06:07:40PM -0700, Randy Dunlap wrote:
>> From: Randy Dunlap <rdunlap@infradead.org>
>>
>> Make the tables be presented as tables in the generated output files
>> (the line drawing did not present well).
>>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Jonathan Corbet <corbet@lwn.net>
>> Cc: linux-doc@vger.kernel.org
>> Cc: Anshuman Khandual <anshuman.khandual@arm.com>
>> Cc: Mike Rapoport <rppt@kernel.org>
>> Cc: linux-arch@vger.kernel.org
>> Cc: linux-mm@kvack.org
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> ---
>>  Documentation/vm/arch_pgtable_helpers.rst |  333 ++++++--------------
>>  1 file changed, 116 insertions(+), 217 deletions(-)
>>
>> --- linux-next-20200707.orig/Documentation/vm/arch_pgtable_helpers.rst
>> +++ linux-next-20200707/Documentation/vm/arch_pgtable_helpers.rst
>> @@ -17,242 +17,141 @@ test need to be in sync.
>>  PTE Page Table Helpers
>>  ======================
>>  
>> ---------------------------------------------------------------------------------
>> -| pte_same                  | Tests whether both PTE entries are the same      |
>> ---------------------------------------------------------------------------------
> 
> According to ReST docs [1] we can use +---+---+ as row delimiter and
> than we can keep | as column delimiter.
> 
> @Andrew, can you please fold the below patch into Anshuman's original
> patch?
> 
> [1] https://docutils.sourceforge.io/docs/user/rst/quickref.html#tables

Works for me. Thanks.
diff mbox series

Patch

--- linux-next-20200707.orig/Documentation/vm/arch_pgtable_helpers.rst
+++ linux-next-20200707/Documentation/vm/arch_pgtable_helpers.rst
@@ -17,242 +17,141 @@  test need to be in sync.
 PTE Page Table Helpers
 ======================
 
---------------------------------------------------------------------------------
-| pte_same                  | Tests whether both PTE entries are the same      |
---------------------------------------------------------------------------------
-| pte_bad                   | Tests a non-table mapped PTE                     |
---------------------------------------------------------------------------------
-| pte_present               | Tests a valid mapped PTE                         |
---------------------------------------------------------------------------------
-| pte_young                 | Tests a young PTE                                |
---------------------------------------------------------------------------------
-| pte_dirty                 | Tests a dirty PTE                                |
---------------------------------------------------------------------------------
-| pte_write                 | Tests a writable PTE                             |
---------------------------------------------------------------------------------
-| pte_special               | Tests a special PTE                              |
---------------------------------------------------------------------------------
-| pte_protnone              | Tests a PROT_NONE PTE                            |
---------------------------------------------------------------------------------
-| pte_devmap                | Tests a ZONE_DEVICE mapped PTE                   |
---------------------------------------------------------------------------------
-| pte_soft_dirty            | Tests a soft dirty PTE                           |
---------------------------------------------------------------------------------
-| pte_swp_soft_dirty        | Tests a soft dirty swapped PTE                   |
---------------------------------------------------------------------------------
-| pte_mkyoung               | Creates a young PTE                              |
---------------------------------------------------------------------------------
-| pte_mkold                 | Creates an old PTE                               |
---------------------------------------------------------------------------------
-| pte_mkdirty               | Creates a dirty PTE                              |
---------------------------------------------------------------------------------
-| pte_mkclean               | Creates a clean PTE                              |
---------------------------------------------------------------------------------
-| pte_mkwrite               | Creates a writable PTE                           |
---------------------------------------------------------------------------------
-| pte_mkwrprotect           | Creates a write protected PTE                    |
---------------------------------------------------------------------------------
-| pte_mkspecial             | Creates a special PTE                            |
---------------------------------------------------------------------------------
-| pte_mkdevmap              | Creates a ZONE_DEVICE mapped PTE                 |
---------------------------------------------------------------------------------
-| pte_mksoft_dirty          | Creates a soft dirty PTE                         |
---------------------------------------------------------------------------------
-| pte_clear_soft_dirty      | Clears a soft dirty PTE                          |
---------------------------------------------------------------------------------
-| pte_swp_mksoft_dirty      | Creates a soft dirty swapped PTE                 |
---------------------------------------------------------------------------------
-| pte_swp_clear_soft_dirty  | Clears a soft dirty swapped PTE                  |
---------------------------------------------------------------------------------
-| pte_mknotpresent          | Invalidates a mapped PTE                         |
---------------------------------------------------------------------------------
-| ptep_get_and_clear        | Clears a PTE                                     |
---------------------------------------------------------------------------------
-| ptep_get_and_clear_full   | Clears a PTE                                     |
---------------------------------------------------------------------------------
-| ptep_test_and_clear_young | Clears young from a PTE                          |
---------------------------------------------------------------------------------
-| ptep_set_wrprotect        | Converts into a write protected PTE              |
---------------------------------------------------------------------------------
-| ptep_set_access_flags     | Converts into a more permissive PTE              |
---------------------------------------------------------------------------------
+===========================   ================================================
+pte_same                      Tests whether both PTE entries are the same
+pte_bad                       Tests a non-table mapped PTE
+pte_present                   Tests a valid mapped PTE
+pte_young                     Tests a young PTE
+pte_dirty                     Tests a dirty PTE
+pte_write                     Tests a writable PTE
+pte_special                   Tests a special PTE
+pte_protnone                  Tests a PROT_NONE PTE
+pte_devmap                    Tests a ZONE_DEVICE mapped PTE
+pte_soft_dirty                Tests a soft dirty PTE
+pte_swp_soft_dirty            Tests a soft dirty swapped PTE
+pte_mkyoung                   Creates a young PTE
+pte_mkold                     Creates an old PTE
+pte_mkdirty                   Creates a dirty PTE
+pte_mkclean                   Creates a clean PTE
+pte_mkwrite                   Creates a writable PTE
+pte_mkwrprotect               Creates a write protected PTE
+pte_mkspecial                 Creates a special PTE
+pte_mkdevmap                  Creates a ZONE_DEVICE mapped PTE
+pte_mksoft_dirty              Creates a soft dirty PTE
+pte_clear_soft_dirty          Clears a soft dirty PTE
+pte_swp_mksoft_dirty          Creates a soft dirty swapped PTE
+pte_swp_clear_soft_dirty      Clears a soft dirty swapped PTE
+pte_mknotpresent              Invalidates a mapped PTE
+ptep_get_and_clear            Clears a PTE
+ptep_get_and_clear_full       Clears a PTE
+ptep_test_and_clear_young     Clears young from a PTE
+ptep_set_wrprotect            Converts into a write protected PTE
+ptep_set_access_flags         Converts into a more permissive PTE
+===========================   ================================================
 
 ======================
 PMD Page Table Helpers
 ======================
 
---------------------------------------------------------------------------------
-| pmd_same                  | Tests whether both PMD entries are the same      |
---------------------------------------------------------------------------------
-| pmd_bad                   | Tests a non-table mapped PMD                     |
---------------------------------------------------------------------------------
-| pmd_leaf                  | Tests a leaf mapped PMD                          |
---------------------------------------------------------------------------------
-| pmd_huge                  | Tests a HugeTLB mapped PMD                       |
---------------------------------------------------------------------------------
-| pmd_trans_huge            | Tests a Transparent Huge Page (THP) at PMD       |
---------------------------------------------------------------------------------
-| pmd_present               | Tests a valid mapped PMD                         |
---------------------------------------------------------------------------------
-| pmd_young                 | Tests a young PMD                                |
---------------------------------------------------------------------------------
-| pmd_dirty                 | Tests a dirty PMD                                |
---------------------------------------------------------------------------------
-| pmd_write                 | Tests a writable PMD                             |
---------------------------------------------------------------------------------
-| pmd_special               | Tests a special PMD                              |
---------------------------------------------------------------------------------
-| pmd_protnone              | Tests a PROT_NONE PMD                            |
---------------------------------------------------------------------------------
-| pmd_devmap                | Tests a ZONE_DEVICE mapped PMD                   |
---------------------------------------------------------------------------------
-| pmd_soft_dirty            | Tests a soft dirty PMD                           |
---------------------------------------------------------------------------------
-| pmd_swp_soft_dirty        | Tests a soft dirty swapped PMD                   |
---------------------------------------------------------------------------------
-| pmd_mkyoung               | Creates a young PMD                              |
---------------------------------------------------------------------------------
-| pmd_mkold                 | Creates an old PMD                               |
---------------------------------------------------------------------------------
-| pmd_mkdirty               | Creates a dirty PMD                              |
---------------------------------------------------------------------------------
-| pmd_mkclean               | Creates a clean PMD                              |
---------------------------------------------------------------------------------
-| pmd_mkwrite               | Creates a writable PMD                           |
---------------------------------------------------------------------------------
-| pmd_mkwrprotect           | Creates a write protected PMD                    |
---------------------------------------------------------------------------------
-| pmd_mkspecial             | Creates a special PMD                            |
---------------------------------------------------------------------------------
-| pmd_mkdevmap              | Creates a ZONE_DEVICE mapped PMD                 |
---------------------------------------------------------------------------------
-| pmd_mksoft_dirty          | Creates a soft dirty PMD                         |
---------------------------------------------------------------------------------
-| pmd_clear_soft_dirty      | Clears a soft dirty PMD                          |
---------------------------------------------------------------------------------
-| pmd_swp_mksoft_dirty      | Creates a soft dirty swapped PMD                 |
---------------------------------------------------------------------------------
-| pmd_swp_clear_soft_dirty  | Clears a soft dirty swapped PMD                  |
---------------------------------------------------------------------------------
-| pmd_mkinvalid             | Invalidates a mapped PMD [1]                     |
---------------------------------------------------------------------------------
-| pmd_set_huge              | Creates a PMD huge mapping                       |
---------------------------------------------------------------------------------
-| pmd_clear_huge            | Clears a PMD huge mapping                        |
---------------------------------------------------------------------------------
-| pmdp_get_and_clear        | Clears a PMD                                     |
---------------------------------------------------------------------------------
-| pmdp_get_and_clear_full   | Clears a PMD                                     |
---------------------------------------------------------------------------------
-| pmdp_test_and_clear_young | Clears young from a PMD                          |
---------------------------------------------------------------------------------
-| pmdp_set_wrprotect        | Converts into a write protected PMD              |
---------------------------------------------------------------------------------
-| pmdp_set_access_flags     | Converts into a more permissive PMD              |
---------------------------------------------------------------------------------
+===========================   ================================================
+pmd_same                      Tests whether both PMD entries are the same
+pmd_bad                       Tests a non-table mapped PMD
+pmd_leaf                      Tests a leaf mapped PMD
+pmd_huge                      Tests a HugeTLB mapped PMD
+pmd_trans_huge                Tests a Transparent Huge Page (THP) at PMD
+pmd_present                   Tests a valid mapped PMD
+pmd_young                     Tests a young PMD
+pmd_dirty                     Tests a dirty PMD
+pmd_write                     Tests a writable PMD
+pmd_special                   Tests a special PMD
+pmd_protnone                  Tests a PROT_NONE PMD
+pmd_devmap                    Tests a ZONE_DEVICE mapped PMD
+pmd_soft_dirty                Tests a soft dirty PMD
+pmd_swp_soft_dirty            Tests a soft dirty swapped PMD
+pmd_mkyoung                   Creates a young PMD
+pmd_mkold                     Creates an old PMD
+pmd_mkdirty                   Creates a dirty PMD
+pmd_mkclean                   Creates a clean PMD
+pmd_mkwrite                   Creates a writable PMD
+pmd_mkwrprotect               Creates a write protected PMD
+pmd_mkspecial                 Creates a special PMD
+pmd_mkdevmap                  Creates a ZONE_DEVICE mapped PMD
+pmd_mksoft_dirty              Creates a soft dirty PMD
+pmd_clear_soft_dirty          Clears a soft dirty PMD
+pmd_swp_mksoft_dirty          Creates a soft dirty swapped PMD
+pmd_swp_clear_soft_dirty      Clears a soft dirty swapped PMD
+pmd_mkinvalid                 Invalidates a mapped PMD [1]
+pmd_set_huge                  Creates a PMD huge mapping
+pmd_clear_huge                Clears a PMD huge mapping
+pmdp_get_and_clear            Clears a PMD
+pmdp_get_and_clear_full       Clears a PMD
+pmdp_test_and_clear_young     Clears young from a PMD
+pmdp_set_wrprotect            Converts into a write protected PMD
+pmdp_set_access_flags         Converts into a more permissive PMD
+===========================   ================================================
 
 ======================
 PUD Page Table Helpers
 ======================
 
---------------------------------------------------------------------------------
-| pud_same                  | Tests whether both PUD entries are the same      |
---------------------------------------------------------------------------------
-| pud_bad                   | Tests a non-table mapped PUD                     |
---------------------------------------------------------------------------------
-| pud_leaf                  | Tests a leaf mapped PUD                          |
---------------------------------------------------------------------------------
-| pud_huge                  | Tests a HugeTLB mapped PUD                       |
---------------------------------------------------------------------------------
-| pud_trans_huge            | Tests a Transparent Huge Page (THP) at PUD       |
---------------------------------------------------------------------------------
-| pud_present               | Tests a valid mapped PUD                         |
---------------------------------------------------------------------------------
-| pud_young                 | Tests a young PUD                                |
---------------------------------------------------------------------------------
-| pud_dirty                 | Tests a dirty PUD                                |
---------------------------------------------------------------------------------
-| pud_write                 | Tests a writable PUD                             |
---------------------------------------------------------------------------------
-| pud_devmap                | Tests a ZONE_DEVICE mapped PUD                   |
---------------------------------------------------------------------------------
-| pud_mkyoung               | Creates a young PUD                              |
---------------------------------------------------------------------------------
-| pud_mkold                 | Creates an old PUD                               |
---------------------------------------------------------------------------------
-| pud_mkdirty               | Creates a dirty PUD                              |
---------------------------------------------------------------------------------
-| pud_mkclean               | Creates a clean PUD                              |
---------------------------------------------------------------------------------
-| pud_mkwrite               | Creates a writable PMD                           |
---------------------------------------------------------------------------------
-| pud_mkwrprotect           | Creates a write protected PMD                    |
---------------------------------------------------------------------------------
-| pud_mkdevmap              | Creates a ZONE_DEVICE mapped PMD                 |
---------------------------------------------------------------------------------
-| pud_mkinvalid             | Invalidates a mapped PUD [1]                     |
---------------------------------------------------------------------------------
-| pud_set_huge              | Creates a PUD huge mapping                       |
---------------------------------------------------------------------------------
-| pud_clear_huge            | Clears a PUD huge mapping                        |
---------------------------------------------------------------------------------
-| pudp_get_and_clear        | Clears a PUD                                     |
---------------------------------------------------------------------------------
-| pudp_get_and_clear_full   | Clears a PUD                                     |
---------------------------------------------------------------------------------
-| pudp_test_and_clear_young | Clears young from a PUD                          |
---------------------------------------------------------------------------------
-| pudp_set_wrprotect        | Converts into a write protected PUD              |
---------------------------------------------------------------------------------
-| pudp_set_access_flags     | Converts into a more permissive PUD              |
---------------------------------------------------------------------------------
+===========================   ================================================
+pud_same                      Tests whether both PUD entries are the same
+pud_bad                       Tests a non-table mapped PUD
+pud_leaf                      Tests a leaf mapped PUD
+pud_huge                      Tests a HugeTLB mapped PUD
+pud_trans_huge                Tests a Transparent Huge Page (THP) at PUD
+pud_present                   Tests a valid mapped PUD
+pud_young                     Tests a young PUD
+pud_dirty                     Tests a dirty PUD
+pud_write                     Tests a writable PUD
+pud_devmap                    Tests a ZONE_DEVICE mapped PUD
+pud_mkyoung                   Creates a young PUD
+pud_mkold                     Creates an old PUD
+pud_mkdirty                   Creates a dirty PUD
+pud_mkclean                   Creates a clean PUD
+pud_mkwrite                   Creates a writable PMD
+pud_mkwrprotect               Creates a write protected PMD
+pud_mkdevmap                  Creates a ZONE_DEVICE mapped PMD
+pud_mkinvalid                 Invalidates a mapped PUD [1]
+pud_set_huge                  Creates a PUD huge mapping
+pud_clear_huge                Clears a PUD huge mapping
+pudp_get_and_clear            Clears a PUD
+pudp_get_and_clear_full       Clears a PUD
+pudp_test_and_clear_young     Clears young from a PUD
+pudp_set_wrprotect            Converts into a write protected PUD
+pudp_set_access_flags         Converts into a more permissive PUD
+===========================   ================================================
 
 ==========================
 HugeTLB Page Table Helpers
 ==========================
 
---------------------------------------------------------------------------------
-| pte_huge                  | Tests a HugeTLB                                  |
---------------------------------------------------------------------------------
-| pte_mkhuge                | Creates a HugeTLB                                |
---------------------------------------------------------------------------------
-| huge_pte_dirty            | Tests a dirty HugeTLB                            |
---------------------------------------------------------------------------------
-| huge_pte_write            | Tests a writable HugeTLB                         |
---------------------------------------------------------------------------------
-| huge_pte_mkdirty          | Creates a dirty HugeTLB                          |
---------------------------------------------------------------------------------
-| huge_pte_mkwrite          | Creates a writable HugeTLB                       |
---------------------------------------------------------------------------------
-| huge_pte_mkwrprotect      | Creates a write protected HugeTLB                |
---------------------------------------------------------------------------------
-| huge_ptep_get_and_clear   | Clears a HugeTLB                                 |
---------------------------------------------------------------------------------
-| huge_ptep_set_wrprotect   | Converts into a write protected HugeTLB          |
---------------------------------------------------------------------------------
-| huge_ptep_set_access_flags  | Converts into a more permissive HugeTLB        |
---------------------------------------------------------------------------------
+============================   ===============================================
+pte_huge                       Tests a HugeTLB
+pte_mkhuge                     Creates a HugeTLB
+huge_pte_dirty                 Tests a dirty HugeTLB
+huge_pte_write                 Tests a writable HugeTLB
+huge_pte_mkdirty               Creates a dirty HugeTLB
+huge_pte_mkwrite               Creates a writable HugeTLB
+huge_pte_mkwrprotect           Creates a write protected HugeTLB
+huge_ptep_get_and_clear        Clears a HugeTLB
+huge_ptep_set_wrprotect        Converts into a write protected HugeTLB
+huge_ptep_set_access_flags     Converts into a more permissive HugeTLB
+============================   ===============================================
 
 ========================
 SWAP Page Table Helpers
 ========================
 
---------------------------------------------------------------------------------
-| __pte_to_swp_entry        | Creates a swapped entry (arch) from a mapepd PTE |
---------------------------------------------------------------------------------
-| __swp_to_pte_entry        | Creates a mapped PTE from a swapped entry (arch) |
---------------------------------------------------------------------------------
-| __pmd_to_swp_entry        | Creates a swapped entry (arch) from a mapepd PMD |
---------------------------------------------------------------------------------
-| __swp_to_pmd_entry        | Creates a mapped PMD from a swapped entry (arch) |
---------------------------------------------------------------------------------
-| is_migration_entry        | Tests a migration (read or write) swapped entry  |
---------------------------------------------------------------------------------
-| is_write_migration_entry  | Tests a write migration swapped entry            |
---------------------------------------------------------------------------------
-| make_migration_entry_read | Converts into read migration swapped entry       |
---------------------------------------------------------------------------------
-| make_migration_entry      | Creates a migration swapped entry (read or write)|
---------------------------------------------------------------------------------
+==========================  =================================================
+__pte_to_swp_entry          Creates a swapped entry (arch) from a mapepd PTE
+__swp_to_pte_entry          Creates a mapped PTE from a swapped entry (arch)
+__pmd_to_swp_entry          Creates a swapped entry (arch) from a mapepd PMD
+__swp_to_pmd_entry          Creates a mapped PMD from a swapped entry (arch)
+is_migration_entry          Tests a migration (read or write) swapped entry
+is_write_migration_entry    Tests a write migration swapped entry
+make_migration_entry_read   Converts into read migration swapped entry
+make_migration_entry        Creates a migration swapped entry (read or write)
+==========================  =================================================
 
 [1] https://lore.kernel.org/linux-mm/20181017020930.GN30832@redhat.com/