lkml.org 
[lkml]   [2023]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [GIT PULL] MM updates for 6.3-rc1
Date
Linus Torvalds <torvalds@linux-foundation.org> writes:

>
> - gcc 12.2.1 quite reasonable complains about some of the new MM code:
>
> mm/migrate.c: In function ‘__migrate_folio_extract’:
> mm/migrate.c:1050:20: note: randstruct: casting between randomized
> structure pointer types (ssa): ‘struct anon_vma’ and ‘struct
> address_space’
>
> 1050 | *anon_vmap = (void *)dst->mapping;
> | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
>
> and while this doesn't cause a build failure ("note" is different
> from "warning"), I do think something needs to be done. Gcc is right.
> This code seems to *work* simply because it's intentionally
> mis-casting pointers,

Yes. The mis-casting is intentional. I just need some place to hold
the data temporarily (save in __migrate_folio_record() and clear in
__migrate_folio_extract()). And "dst" is newly allocated folio.

> but I think it needs to be seriously looked at and something done to
> make gcc happy (and a *LARGE* comment about it).

Sure. I will check whether there's some way to make gcc happy and add
some comments about that. There's some comments for
__migrate_folio_extract(), but that's isn't enough apprently.)

> That last note is not some merge result, it's purely about the new MM code.
>

[snip]

Best Regards,
Huang, Ying

\
 
 \ /
  Last update: 2023-03-27 00:34    [W:0.270 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site