From: David Hildenbrand <david@redhat.com>
To: Vasily Averin <vvs@virtuozzo.com>,
Vlastimil Babka <vbabka@suse.cz>,
Michal Hocko <mhocko@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, kernel@openvz.org,
Mel Gorman <mgorman@techsingularity.net>,
Uladzislau Rezki <urezki@gmail.com>
Subject: Re: [PATCH memcg] mm/page_alloc.c: avoid statistic update with 0
Date: Tue, 12 Oct 2021 13:09:27 +0200 [thread overview]
Message-ID: <0a707990-f12c-3c60-2a96-e1d531e100a6@redhat.com> (raw)
In-Reply-To: <f52c5cd3-9b74-0fd5-2b7b-83ca21c52b2a@virtuozzo.com>
On 12.10.21 12:42, Vasily Averin wrote:
> On 08.10.2021 14:47, Vlastimil Babka wrote:
>> On 10/8/21 11:24, Vasily Averin wrote:
>>> __alloc_pages_bulk can call __count_zid_vm_events and zone_statistics
>>> with nr_account = 0.
>>
>> But that's not a bug, right? Just an effective no-op that's not commonly
>> happening, so is it worth the check?
>
> Why not?
>
> Yes, it's not a bug, it just makes the kernel a bit more efficient in a very unlikely case.
> However, it looks strange and makes uninformed code reviewers like me worry about possible
> problems inside the affected functions. No one else calls these functions from 0.
>
If it's not a BUG we'd better leave "Fixes:" tags away., it tends to
confuse people looking for actual BUGs.
I'm also not sure if this micro-optimization is worth it. "bit more
efficient in a very unlikely case" doesn't sound very compelling ... and
personally I'd assume accounting functions can deal with a delta of 0.
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2021-10-12 11:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-08 9:24 [PATCH memcg] mm/page_alloc.c: avoid statistic update with 0 Vasily Averin
2021-10-08 11:47 ` Vlastimil Babka
2021-10-12 10:42 ` Vasily Averin
2021-10-12 11:09 ` David Hildenbrand [this message]
2021-10-12 11:38 ` Mel Gorman
2021-10-12 12:02 ` Chris Down
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=0a707990-f12c-3c60-2a96-e1d531e100a6@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=kernel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=urezki@gmail.com \
--cc=vbabka@suse.cz \
--cc=vdavydov.dev@gmail.com \
--cc=vvs@virtuozzo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).