Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1372424

PG_reserved and compound pages

From Frank Mehnert <frank.mehnert@oracle.com>
Newsgroups linux.kernel
Subject PG_reserved and compound pages
Date 2016-04-06 13:30 +0200
Message-ID <rkTOP-33a-49@gated-at.bofh.it> (permalink)
Organization Oracle Corporation

Show all headers | View raw


Hi,

Linux 4.5 introduced additional checks to ensure that compound pages are
never marked as reserved. In our code we use PG_reserved to ensure that
the kernel does never swap out such pages, e.g.

  int i;
  struct page *pages = alloc_pages(GFP_HIGHUSER | __GFP_COMP, 4);
  for (i = 0; i < 16; i++)
    SetPageReserved(&pages[i]);

The purpose of setting PG_reserved is to prevent the kernel from swapping
this memory out. This worked with older kernel but not with Linux 4.5 as
setting PG_reserved to compound pages is not allowed any more.

Can somebody explain how we can achieve the same result in accordance to
the new Linux 4.5 rules?

Thanks,

Frank
-- 
Dr.-Ing. Frank Mehnert | Software Development Director, VirtualBox
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | 71384 Weinstadt, Germany

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

PG_reserved and compound pages Frank Mehnert <frank.mehnert@oracle.com> - 2016-04-06 13:30 +0200
  Re: PG_reserved and compound pages Michal Hocko <mhocko@kernel.org> - 2016-04-06 17:10 +0200
    Re: Re: PG_reserved and compound pages Frank Mehnert <frank.mehnert@oracle.com> - 2016-04-06 17:20 +0200
      Re: Re: PG_reserved and compound pages Michal Hocko <mhocko@kernel.org> - 2016-04-06 17:40 +0200
        Re: Re: Re: PG_reserved and compound pages Frank Mehnert <frank.mehnert@oracle.com> - 2016-04-07 15:50 +0200
          Re: Re: Re: PG_reserved and compound pages Michal Hocko <mhocko@kernel.org> - 2016-04-07 17:30 +0200

csiph-web