All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Michal Hocko <mhocko@kernel.org>
Cc: vatsa@codeaurora.org, linux-mm@kvack.org,
	Arun KS <arunks@codeaurora.org>,
	getarunks@gmail.com, kys@microsoft.com, dan.j.williams@intel.com,
	sthemmin@microsoft.com, xen-devel@lists.xenproject.org,
	haiyangz@microsoft.com, yasu.isimatu@gmail.com,
	boris.ostrovsky@oracle.com, Vlastimil Babka <vbabka@suse.cz>,
	osalvador@suse.de, jgross@suse.com, aaron.lu@intel.com,
	malat@debian.org, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, vinmenon@codeaurora.org,
	jrdr.linux@gmail.com, devel@linuxdriverproject.org,
	iamjoonsoo.kim@lge.com, mgorman@techsingularity.net,
	kirill.shutemov@linux.intel.com
Subject: Re: [PATCH v5 1/2] memory_hotplug: Free pages as higher order
Date: Thu, 18 Oct 2018 19:18:25 -0700	[thread overview]
Message-ID: <20181018191825.fcad6e28f32a3686f201acdf__38679.8126892701$1539915430$gmane$org@linux-foundation.org> (raw)
In-Reply-To: <20181011075503.GQ5873@dhcp22.suse.cz>

On Thu, 11 Oct 2018 09:55:03 +0200 Michal Hocko <mhocko@kernel.org> wrote:

> > > > > This is now not called anymore, although the xen/hv variants still do
> > > > > it. The function seems empty these days, maybe remove it as a followup
> > > > > cleanup?
> > > > >
> > > > > > -	__online_page_increment_counters(page);
> > > > > > -	__online_page_free(page);
> > > > > > +	__free_pages_core(page, order);
> > > > > > +	totalram_pages += (1UL << order);
> > > > > > +#ifdef CONFIG_HIGHMEM
> > > > > > +	if (PageHighMem(page))
> > > > > > +		totalhigh_pages += (1UL << order);
> > > > > > +#endif
> > > > >
> > > > > __online_page_increment_counters() would have used
> > > > > adjust_managed_page_count() which would do the changes under
> > > > > managed_page_count_lock. Are we safe without the lock? If yes, there
> > > > > should perhaps be a comment explaining why.
> > > > 
> > > > Looks unsafe without managed_page_count_lock.
> > > 
> > > Why does it matter actually? We cannot online/offline memory in
> > > parallel. This is not the case for the boot where we initialize memory
> > > in parallel on multiple nodes. So this seems to be safe currently unless
> > > I am missing something. A comment explaining that would be helpful
> > > though.
> > 
> > Other main callers of adjust_manage_page_count(),
> > 
> > static inline void free_reserved_page(struct page *page)
> > {
> >         __free_reserved_page(page);
> >         adjust_managed_page_count(page, 1);
> > }
> > 
> > static inline void mark_page_reserved(struct page *page)
> > {
> >         SetPageReserved(page);
> >         adjust_managed_page_count(page, -1);
> > }
> > 
> > Won't they race with memory hotplug?
> > 
> > Few more,
> > ./drivers/xen/balloon.c:519:            adjust_managed_page_count(page, -1);
> > ./drivers/virtio/virtio_balloon.c:175:  adjust_managed_page_count(page, -1);
> > ./drivers/virtio/virtio_balloon.c:196:  adjust_managed_page_count(page, 1);
> > ./mm/hugetlb.c:2158:                    adjust_managed_page_count(page, 1 <<
> > h->order);
> 
> They can, and I have missed those.

So this patch needs more work, yes?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-10-19  2:18 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05  8:10 [PATCH v5 1/2] memory_hotplug: Free pages as higher order Arun KS
2018-10-05  8:10 ` [PATCH v5 2/2] mm/page_alloc: remove software prefetching in __free_pages_core Arun KS
2018-10-05  8:10 ` Arun KS
2018-10-09  9:30   ` Michal Hocko
2018-10-09  9:30   ` Michal Hocko
2018-10-10 16:36   ` Vlastimil Babka
2018-10-10 16:36   ` Vlastimil Babka
2018-10-08  7:34 ` [PATCH v5 1/2] memory_hotplug: Free pages as higher order Oscar Salvador
2018-10-08  7:34 ` Oscar Salvador
2018-10-09  9:29 ` Michal Hocko
2018-10-09  9:29 ` Michal Hocko
2018-10-09  9:54   ` Arun KS
2018-10-09 11:06     ` Michal Hocko
2018-10-09 11:06     ` Michal Hocko
2018-10-09  9:54   ` Arun KS
2018-10-10  8:07 ` Oscar Salvador
2018-10-10  8:07 ` Oscar Salvador
2018-10-10 10:51   ` Arun KS
2018-10-10 10:51   ` Arun KS
2018-10-10 11:01     ` Oscar Salvador
2018-10-10 11:01     ` Oscar Salvador
2018-10-10 15:30 ` Vlastimil Babka
2018-10-10 15:30 ` Vlastimil Babka
2018-10-10 16:56   ` Arun KS
2018-10-10 17:33     ` Michal Hocko
2018-10-10 17:33     ` Michal Hocko
2018-10-11  2:29       ` Arun KS
2018-10-11  7:55         ` Michal Hocko
2018-10-19  2:18           ` Andrew Morton [this message]
2018-10-19  2:18           ` Andrew Morton
2018-10-19  8:07             ` Michal Hocko
2018-10-19  8:07             ` Michal Hocko
2018-10-22 10:33               ` Arun KS
2018-10-22 10:33               ` Arun KS
2018-11-05  9:42                 ` Arun KS
2018-11-05 21:44                   ` Andrew Morton
2018-11-06  5:31                     ` Arun KS
2018-11-06  5:31                     ` Arun KS
2018-11-05 21:44                   ` Andrew Morton
2018-11-05  9:42                 ` Arun KS
2018-10-11  7:55         ` Michal Hocko
2018-10-11  2:29       ` Arun KS
2018-10-11  8:07     ` Vlastimil Babka
2018-10-11  8:07     ` Vlastimil Babka
2018-10-11  8:15       ` Michal Hocko
2018-10-11  8:15       ` Michal Hocko
2018-11-19 22:15       ` Wei Yang
2018-11-19 22:15       ` Wei Yang
2018-10-10 16:56   ` Arun KS
  -- strict thread matches above, loose matches on Subject: below --
2018-10-05  8:10 Arun KS

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20181018191825.fcad6e28f32a3686f201acdf__38679.8126892701$1539915430$gmane$org@linux-foundation.org' \
    --to=akpm@linux-foundation.org \
    --cc=aaron.lu@intel.com \
    --cc=arunks@codeaurora.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=dan.j.williams@intel.com \
    --cc=devel@linuxdriverproject.org \
    --cc=getarunks@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=jgross@suse.com \
    --cc=jrdr.linux@gmail.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=malat@debian.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=osalvador@suse.de \
    --cc=sthemmin@microsoft.com \
    --cc=vatsa@codeaurora.org \
    --cc=vbabka@suse.cz \
    --cc=vinmenon@codeaurora.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yasu.isimatu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.