Bug 1661568

Summary: Tons of BUG: non-zero pgtables_bytes on freeing mm: -16384" in the 4.19 kernel of f29
Product: [Fedora] Fedora Reporter: Christian Borntraeger <borntraeger>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 29CC: airlied, borntraeger, bskeggs, bugproxy, dan, ewk, hannsj_uhl, hdegoede, ichavero, itamar, jarodwilson, jglisse, john.j5live, jonathan, josef, kernel-maint, linville, mchehab, mjg59, steved, y9t7sypezp
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: kernel-4.19.13-200.fc28 kernel-4.19.13-300.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-04 12:28:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 467765    

Description Christian Borntraeger 2018-12-21 15:33:28 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Build Identifier: 

I see (for almost every process)
the following message
BUG: non-zero pgtables_bytes on freeing mm: -16384"
after upgrading from the 4.18 to 4.19 kernel (via yum).

Reproducible: Always

Steps to Reproduce:
update your fedora 29 on s390x to latest greatest kernel 4.19.9-300.fc29.s390x
Actual Results:  
BUG: non-zero pgtables_bytes on freeing mm: -16384"

Expected Results:  
no bug messages in dmesg

This seems to have been fixed upstream with 

e12e4044aede9 s390/mm: fix mis-accounting of pgtable_bytes

dependencies are probably the following commits:

6d212db11947a mm: add mm_pxd_folded checks to pgtable_bytes accounting functions
1071fc5779d98 mm: introduce mm_[p4d|pud|pmd]_folded
a8874e7e8a889 mm: make the __PAGETABLE_PxD_FOLDED defines non-empty

Comment 1 Steve 2018-12-23 04:45:34 UTC
(In reply to Christian Borntraeger from comment #0)
...
> This seems to have been fixed upstream with 
> 
> e12e4044aede9 s390/mm: fix mis-accounting of pgtable_bytes
...

That appears to have gone into v4.20-rc2, so you might try a rawhide kernel:
https://mirrors.kernel.org/fedora/development/rawhide/Everything/x86_64/os/Packages/k/

s390/mm: fix mis-accounting of pgtable_bytes
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v4.20-rc2&id=e12e4044aede97974f2222eb7f0ed726a5179a32

There was also a later merge commit with the same patch:

Merge tag 's390-4.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v4.20-rc2&id=3541833fd1f264e7579e573a6586a1b665da37db

Comment 2 Steve 2018-12-23 05:47:45 UTC
(In reply to Steve from comment #1)

> ... so you might try a rawhide kernel:
> https://mirrors.kernel.org/fedora/development/rawhide/Everything/x86_64/os/
> Packages/k/

Link to s390x architecture:
https://mirrors.kernel.org/fedora-secondary/development/rawhide/Everything/s390x/os/Packages/k/

Comment 3 Christian Borntraeger 2018-12-27 08:36:50 UTC
FWIW, 4.19.2-301.fc29.s390x does not have the issue, so the warning must have sneaked in between 4.19.2 and 4.19.10

The 4.20 from rawhide does not have the pgtable_bytes issue but it is crashing very early in random places when running on f29. No idea yet whats wrong (the same kernel runs fine when booting that via virt-install from
pub/fedora-secondary/development/rawhide/Server/s390x/os/

Comment 4 Christian Borntraeger 2018-12-27 09:13:41 UTC
Seems that this is caused by a partial backport of e12e4044aede9 s390/mm: fix mis-accounting of pgtable_bytes in 4.19.5

See https://lore.kernel.org/lkml/4e58571e-1991-4a70-7012-ff9dd76afee3@de.ibm.com/T/#u

Comment 5 Dan HorĂ¡k 2019-01-04 12:26:02 UTC
Reading the thread mentioned in comment #4 there will be a fix in the stable 4.19 tree. And looking into the 4.19 log it's already in 4.19.13.

Comment 6 Christian Borntraeger 2019-01-07 12:47:26 UTC
I can confirm that 4.19.13-300.fc29.s390x fixes the issue.