]> git.baikalelectronics.ru Git - kernel.git/commit
sparc32: mm: Only call ctor()/dtor() functions for first and last user
authorWill Deacon <will@kernel.org>
Tue, 26 May 2020 17:33:02 +0000 (18:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Jun 2020 01:45:51 +0000 (18:45 -0700)
commit3f90a7bad594c64618c6ebf762f2b17a5277f261
tree3b849e4c43873e8fc1fead51e5531bcb2d0d2b19
parentcf72d2de9dbadefcbbb2c22f6188bda64b371897
sparc32: mm: Only call ctor()/dtor() functions for first and last user

The SRMMU page-table allocator allocates multiple PTE tables per page,
since they are only 1K in size. However, this means that calls to
pgtable_pte_page_{ctor,dtor}() must be serialised and performed only by
the first and last page-table allocation for the page respectively.

Use the page reference count to track how many PTE tables we have
allocated for a given page returned by the SRMMU allocator and only
call the ctor()/dtor() functions for the first and last user respectively.

Cc: David S. Miller <davem@davemloft.net>
Fixes: f3be1d9f8fdc ("sparc32: mm: Reduce allocation size for PMD and PTE tables")
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/mm/srmmu.c