Re: [PATCH] parisc: Fix flush_anon_page on PA8800/PA8900

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022-06-18 9:18 p.m., John David Anglin wrote:
Shared anonymous mappings only work when the mappings are equivalent or meet the
requirements for multi reader, single writer.  The problem is we don't in general know what
mappings are equivalent on PA8800/PA8900 processors.
This change introduced the possibility that shared mappings might not be equivalent on parisc:
https://marc.info/?l=git-commits-head&m=139776619924910&w=2

The shmat() man page describes SHMLBA as follows:

       SHMLBA Segment low boundary address multiple.  When explicitly specify-
              ing an attach address in a call to shmat(),  the caller  should
              ensure  that  the  address is a multiple of this value.  This is
              necessary on some architectures, in order either to ensure  good
              CPU  cache  performance  or to ensure that different attaches of
              the same segment have consistent views  within  the CPU  cache.
              SHMLBA  is  normally some multiple of the system page size.  (On
              many Linux architectures, SHMLBA is the same as the system  page
              size.)

Further, the manpage states:

       o If  shmaddr  is  NULL,  the  system chooses a suitable (unused) page-
         aligned address to attach the segment.

       o If shmaddr isn't NULL and SHM_RND is specified in shmflg, the  attach
         occurs  at  the  address equal to shmaddr rounded down to the nearest
         multiple of SHMLBA.

       o Otherwise, shmaddr must be a page-aligned address at which the attach
         occurs.

Thus, shared mappings may not be equivalent and we need to flush all aliases.

Dave

--
John David Anglin  dave.anglin@xxxxxxxx




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux