[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH] mm: convert totalram_pages, totalhigh_pages and managed_pages to atomic.
- To: Arun KS <arunks@xxxxxxxxxxxxxx>
- From: Guo Ren <ren_guo@xxxxxxxxx>
- Date: Thu, 22 Nov 2018 09:33:10 +0800
- Cc: Mike Snitzer <snitzer@xxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Kemi Wang <kemi.wang@xxxxxxxxx>, dri-devel@xxxxxxxxxxxxxxxxxxxxx, "J. Bruce Fields" <bfields@xxxxxxxxxxxx>, linux-sctp@xxxxxxxxxxxxxxx, Paul Mackerras <paulus@xxxxxxxxx>, Pavel Machek <pavel@xxxxxx>, Christoph Lameter <cl@xxxxxxxxx>, "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>, Sumit Semwal <sumit.semwal@xxxxxxxxxx>, "David \(ChunMing\) Zhou" <David1.Zhou@xxxxxxx>, Petr Tesarik <ptesarik@xxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, ceph-devel@xxxxxxxxxxxxxxx, James Morris <jmorris@xxxxxxxxx>, kasan-dev@xxxxxxxxxxxxxxxx, Marcos Paulo de Souza <marcos.souza.org@xxxxxxxxx>, "Steven J. Hill" <steven.hill@xxxxxxxxxx>, David Rientjes <rientjes@xxxxxxxxxx>, Anthony Yznaga <anthony.yznaga@xxxxxxxxxx>, Daniel Vacek <neelx@xxxxxxxxxx>, Roman Gushchin <guro@xxxxxx>, Len Brown <len.brown@xxxxxxxxx>, linux-pm@xxxxxxxxxxxxxxx, Vlastimil Babka <vbabka@xxxxxxx>, linux-um@xxxxxxxxxxxxxxxxxxx, Mike Rapoport <rppt@xxxxxxxxxxxxxxxxxx>, Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>, Anton Altaparmakov <anton@xxxxxxxxxx>, linux-parisc@xxxxxxxxxxxxxxx, Mathieu Malaterre <malat@xxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxxx>, "Rafael J. Wysocki" <rjw@xxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Cyril Bur <cyrilbur@xxxxxxxxx>, Arve Hjønnevåg <arve@xxxxxxxxxxx>, netfilter-devel@xxxxxxxxxxxxxxx, Souptick Joarder <jrdr.linux@xxxxxxxxx>, Dmitry Kasatkin <dmitry.kasatkin@xxxxxxxxx>, Alex Deucher <alexander.deucher@xxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Andrew-CT Chen <andrew-ct.chen@xxxxxxxxxxxx>, "Gustavo A. R. Silva" <gustavo@xxxxxxxxxxxxxx>, David Airlie <airlied@xxxxxxxx>, dm-devel@xxxxxxxxxx, Nadav Amit <namit@xxxxxxxxxx>, Omar Sandoval <osandov@xxxxxx>, Alasdair Kergon <agk@xxxxxxxxxx>, linux-s390@xxxxxxxxxxxxxxx, Stephen Hemminger <sthemmin@xxxxxxxxxxxxx>, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, Helge Deller <deller@xxxxxx>, Hugh Dickins <hughd@xxxxxxxxxx>, "Luis R. Rodriguez" <mcgrof@xxxxxxxxxx>, coreteam@xxxxxxxxxxxxx, Jozsef Kadlecsik <kadlec@xxxxxxxxxxxxxxxxx>, Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>, linux-media@xxxxxxxxxxxxxxx, YueHaibing <yuehaibing@xxxxxxxxxx>, Todd Kjos <tkjos@xxxxxxxxxxx>, Philippe Ombredanne <pombredanne@xxxxxxxx>, Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>, Jia He <jia.he@xxxxxxxxxxxxxxxx>, Tejun Heo <tj@xxxxxxxxxx>, Shakeel Butt <shakeelb@xxxxxxxxxx>, Houlong Wei <houlong.wei@xxxxxxxxxxxx>, devel@xxxxxxxxxxxxxxxxxxxxxx, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Martijn Coenen <maco@xxxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, Khalid Aziz <khalid@xxxxxxxxxxxxxx>, Oded Gabbay <oded.gabbay@xxxxxxxxx>, linaro-mm-sig@xxxxxxxxxxxxxxxx, linux-ntfs-dev@xxxxxxxxxxxxxxxxxxxxx, Jonathan Corbet <corbet@xxxxxxx>, Florian Westphal <fw@xxxxxxxxx>, Anna Schumaker <anna.schumaker@xxxxxxxxxx>, Pekka Enberg <penberg@xxxxxxxxxx>, Minchan Kim <minchan@xxxxxxxxxx>, Eric Biederman <ebiederm@xxxxxxxxxxxx>, "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxx>, Martin Schwidefsky <schwidefsky@xxxxxxxxxx>, Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>, Kate Stewart <kstewart@xxxxxxxxxxxxxxxxxxx>, Marcelo Ricardo Leitner <marcelo.leitner@xxxxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>, Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>, Heiko Carstens <heiko.carstens@xxxxxxxxxx>, Stefan Agner <stefan@xxxxxxxx>, "James E.J. Bottomley" <jejb@xxxxxxxxxxxxxxxx>, netdev@xxxxxxxxxxxxxxx, amd-gfx@xxxxxxxxxxxxxxxxxxxxx, Jan Kara <jack@xxxxxxx>, Alexander Duyck <alexander.h.duyck@xxxxxxxxxxxxxxx>, Gerrit Renker <gerrit@xxxxxxxxxxxxxx>, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>, Miklos Szeredi <miklos@xxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Matthew Wilcox <willy@xxxxxxxxxxxxx>, Konstantin Khlebnikov <khlebnikov@xxxxxxxxxxxxxx>, Matthew Auld <matthew.auld@xxxxxxxxx>, Huang Ying <ying.huang@xxxxxxxxx>, Alexey Kuznetsov <kuznet@xxxxxxxxxxxxx>, Ilya Dryomov <idryomov@xxxxxxxxx>, Alexey Dobriyan <adobriyan@xxxxxxxxx>, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>, "Serge E. Hallyn" <serge@xxxxxxxxxx>, Kees Cook <keescook@xxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>, Mark Brown <broonie@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>, Dan Williams <dan.j.williams@xxxxxxxxx>, Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>, Dan Streetman <ddstreet@xxxxxxxx>, Oscar Salvador <osalvador@xxxxxxx>, linux-nfs@xxxxxxxxxxxxxxx, Neil Horman <nhorman@xxxxxxxxxxxxx>, Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>, Jeff Layton <jlayton@xxxxxxxxxx>, Eric Dumazet <edumazet@xxxxxxxxxx>, Jessica Yu <jeyu@xxxxxxxxxx>, Joe Perches <joe@xxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx>, Michal Hocko <mhocko@xxxxxxxx>, Minghsiu Tsai <minghsiu.tsai@xxxxxxxxxxxx>, Christian König <christian.koenig@xxxxxxx>, "VMware, Inc." <pv-drivers@xxxxxxxxxx>, Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>, Russell Currey <ruscur@xxxxxxxxxx>, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>, linux-mm@xxxxxxxxx, Alexander Potapenko <glider@xxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, getarunks@xxxxxxxxx, Chintan Pandya <cpandya@xxxxxxxxxxxxxx>, devel@xxxxxxxxxxxxxxxxxxxx, "Yan, Zheng" <zyan@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Sage Weil <sage@xxxxxxxxxx>, dccp@xxxxxxxxxxxxxxx, Richard Weinberger <richard@xxxxxx>, Seth Jennings <sjenning@xxxxxxxxxx>, x86@xxxxxxxxxx, Ingo Molnar <mingo@xxxxxxxxxx>, Laura Abbott <labbott@xxxxxxxxxx>, Mimi Zohar <zohar@xxxxxxxxxxxxxxxxxx>, Jeff Dike <jdike@xxxxxxxxxxx>, Pavel Tatashin <pavel.tatashin@xxxxxxxxxxxxx>, Jann Horn <jannh@xxxxxxxxxx>, Xavier Deguillard <xdeguillard@xxxxxxxxxx>, Johannes Weiner <hannes@xxxxxxxxxxx>, Jérôme Glisse <jglisse@xxxxxxxxxx>, Kirill Tkhai <ktkhai@xxxxxxxxxxxxx>, linux-mediatek@xxxxxxxxxxxxxxxxxxx, Matthias Brugger <matthias.bgg@xxxxxxxxx>, Tiffany Lin <tiffany.lin@xxxxxxxxxxxx>, linux-integrity@xxxxxxxxxxxxxxx, Dmitry Vyukov <dvyukov@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx>, Hideaki YOSHIFUJI <yoshfuji@xxxxxxxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx, Vlad Yasevich <vyasevich@xxxxxxxxx>, linux-decnet-user@xxxxxxxxxxxxxxxxxxxxx, kexec@xxxxxxxxxxxxxxxxxxx, linux-security-module@xxxxxxxxxxxxxxx, Thomas Zimmermann <tzimmermann@xxxxxxx>, Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>, Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 22 Nov 2018 05:47:51 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Oct 22, 2018 at 10:53:22PM +0530, Arun KS wrote:
> Remove managed_page_count_lock spinlock and instead use atomic
> variables.
>
> Suggested-by: Michal Hocko <mhocko@xxxxxxxx>
> Suggested-by: Vlastimil Babka <vbabka@xxxxxxx>
> Signed-off-by: Arun KS <arunks@xxxxxxxxxxxxxx>
>
> ---
> As discussed here,
> https://patchwork.kernel.org/patch/10627521/#22261253
> ---
> ---
> arch/csky/mm/init.c | 4 +-
> arch/powerpc/platforms/pseries/cmm.c | 11 ++--
> arch/s390/mm/init.c | 2 +-
> arch/um/kernel/mem.c | 4 +-
> arch/x86/kernel/cpu/microcode/core.c | 5 +-
> drivers/char/agp/backend.c | 4 +-
> drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 2 +-
> drivers/gpu/drm/i915/i915_gem.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 4 +-
> drivers/hv/hv_balloon.c | 19 +++----
> drivers/md/dm-bufio.c | 5 +-
> drivers/md/dm-crypt.c | 4 +-
> drivers/md/dm-integrity.c | 4 +-
> drivers/md/dm-stats.c | 3 +-
> drivers/media/platform/mtk-vpu/mtk_vpu.c | 3 +-
> drivers/misc/vmw_balloon.c | 2 +-
> drivers/parisc/ccio-dma.c | 5 +-
> drivers/parisc/sba_iommu.c | 5 +-
> drivers/staging/android/ion/ion_system_heap.c | 2 +-
> drivers/xen/xen-selfballoon.c | 7 +--
> fs/ceph/super.h | 3 +-
> fs/file_table.c | 9 ++--
> fs/fuse/inode.c | 4 +-
> fs/nfs/write.c | 3 +-
> fs/nfsd/nfscache.c | 3 +-
> fs/ntfs/malloc.h | 2 +-
> fs/proc/base.c | 3 +-
> include/linux/highmem.h | 2 +-
> include/linux/mm.h | 2 +-
> include/linux/mmzone.h | 10 +---
> include/linux/swap.h | 2 +-
> kernel/fork.c | 6 +--
> kernel/kexec_core.c | 5 +-
> kernel/power/snapshot.c | 2 +-
> lib/show_mem.c | 3 +-
> mm/highmem.c | 2 +-
> mm/huge_memory.c | 2 +-
> mm/kasan/quarantine.c | 4 +-
> mm/memblock.c | 6 +--
> mm/memory_hotplug.c | 4 +-
> mm/mm_init.c | 3 +-
> mm/oom_kill.c | 2 +-
> mm/page_alloc.c | 75
> ++++++++++++++-------------
> mm/shmem.c | 12 +++--
> mm/slab.c | 3 +-
> mm/swap.c | 3 +-
> mm/util.c | 2 +-
> mm/vmalloc.c | 4 +-
> mm/vmstat.c | 4 +-
> mm/workingset.c | 2 +-
> mm/zswap.c | 2 +-
> net/dccp/proto.c | 6 +--
> net/decnet/dn_route.c | 2 +-
> net/ipv4/tcp_metrics.c | 2 +-
> net/netfilter/nf_conntrack_core.c | 6 +--
> net/netfilter/xt_hashlimit.c | 4 +-
> net/sctp/protocol.c | 6 +--
> security/integrity/ima/ima_kexec.c | 2 +-
> 58 files changed, 171 insertions(+), 143 deletions(-)
>
> diff --git a/arch/csky/mm/init.c b/arch/csky/mm/init.c
> index dc07c07..3f4d35e 100644
> --- a/arch/csky/mm/init.c
> +++ b/arch/csky/mm/init.c
> @@ -71,7 +71,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
> ClearPageReserved(virt_to_page(start));
> init_page_count(virt_to_page(start));
> free_page(start);
> - totalram_pages++;
> + atomic_long_inc(&totalram_pages);
> }
> }
> #endif
> @@ -88,7 +88,7 @@ void free_initmem(void)
> ClearPageReserved(virt_to_page(addr));
> init_page_count(virt_to_page(addr));
> free_page(addr);
> - totalram_pages++;
> + atomic_long_inc(&totalram_pages);
> addr += PAGE_SIZE;
> }
For csky part, it's OK.
Guo Ren
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|