[RFC,0/2] mm: Use pte marker for swapin errors

Message ID 20221024204830.1342169-1-peterx@redhat.com
Headers
Series mm: Use pte marker for swapin errors |

Message

Peter Xu Oct. 24, 2022, 8:48 p.m. UTC
  Hi,

This series uses the pte marker to replace the swapin error swap entry,
then we safe one more swap entry.  A new pte marker bit is defined.

One thing worth mentioning: we need the pte marker to be always built to
make sure it works like before, so I made an attempt in patch 1 to drop
CONFIG_PTE_MARKER and always compile pte marker in.  Since pte markers are
enabled in many distributions by default already, meanwhile the codeset is
really small I assume it's fine.  But still I'm tagging with RFC for this
initial version.

Smoke tested on anonymous mem on a fake swap failure.  Please have a look,
thanks.

Peter Xu (2):
  mm: Always compile in pte markers
  mm: Use pte markers for swap errors

 include/linux/swap.h    | 16 ++++----------
 include/linux/swapops.h | 49 +++++++++--------------------------------
 mm/Kconfig              |  7 ------
 mm/memory.c             | 13 ++++++-----
 mm/shmem.c              |  2 +-
 mm/swapfile.c           |  2 +-
 6 files changed, 23 insertions(+), 66 deletions(-)
  

Comments

Huang, Ying Oct. 25, 2022, 3:01 a.m. UTC | #1
Peter Xu <peterx@redhat.com> writes:

> Hi,
>
> This series uses the pte marker to replace the swapin error swap entry,
> then we safe one more swap entry.  A new pte marker bit is defined.
          ~~~~               ~~~~~
          save?              file?

It's good to save one swap file.  Thanks for your patch!  Please feel
free to add my

Reviewed-by: "Huang, Ying" <ying.huang@intel.com>

for the whole series.

Best Regards,
Huang, Ying

> One thing worth mentioning: we need the pte marker to be always built to
> make sure it works like before, so I made an attempt in patch 1 to drop
> CONFIG_PTE_MARKER and always compile pte marker in.  Since pte markers are
> enabled in many distributions by default already, meanwhile the codeset is
> really small I assume it's fine.  But still I'm tagging with RFC for this
> initial version.
>
> Smoke tested on anonymous mem on a fake swap failure.  Please have a look,
> thanks.
>
> Peter Xu (2):
>   mm: Always compile in pte markers
>   mm: Use pte markers for swap errors
>
>  include/linux/swap.h    | 16 ++++----------
>  include/linux/swapops.h | 49 +++++++++--------------------------------
>  mm/Kconfig              |  7 ------
>  mm/memory.c             | 13 ++++++-----
>  mm/shmem.c              |  2 +-
>  mm/swapfile.c           |  2 +-
>  6 files changed, 23 insertions(+), 66 deletions(-)
  
Peter Xu Oct. 25, 2022, 3:08 p.m. UTC | #2
On Tue, Oct 25, 2022 at 11:01:32AM +0800, Huang, Ying wrote:
> Peter Xu <peterx@redhat.com> writes:
> 
> > Hi,
> >
> > This series uses the pte marker to replace the swapin error swap entry,
> > then we safe one more swap entry.  A new pte marker bit is defined.
>           ~~~~               ~~~~~
>           save?              file?
> 
> It's good to save one swap file.  Thanks for your patch!  Please feel
> free to add my
> 
> Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
> 
> for the whole series.

Thanks for the quick feedback, Ying.  I'll wait for a few more days before
a repost.