[PATCH] BC: aidband - uncharge UB pages before charging to PB
By design we assume that page may be accounted only in UB or only
in PB counter.
Unfortunately this is not always true, and ATI driver does
some strange things like mmaping pages with PTEs to user space
(maybe it is even a security hole in ATI driver, who knows?)
So ATI driver exports pages via mmap(2) to userspace
which was already accounted in UB (pte pages are charged to kmemsize).
In this case accounting conflict happens and
BUG_ON(head->pb_magic != PB_MAGIC) is triggered.
Solution: Uncharge page from UB counter and account it in PB.
Changes from v1: Add WARN_ON_ONCE according to Pavel's cmomments.