From: Peter Zijlstra <peterz@infradead.org>
To: Cheng Jian <cj.chengjian@huawei.com>
Cc: huawei.libin@huawei.com, xiexiuqi@huawei.com,
yangyingliang@huawei.com, mingo@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/fair: Use 'unsigned long' for group_shares,group_runnable
Date: Mon, 15 Apr 2019 14:46:17 +0200 [thread overview]
Message-ID: <20190415124617.GP11158@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190413033234.30002-1-cj.chengjian@huawei.com>
On Sat, Apr 13, 2019 at 03:32:34AM +0000, Cheng Jian wrote:
> group_share and group_runnable are tracked as 'unsigned long',
> however some functions using them as 'long' which is ultimately
> assigned back to 'unsigned long' variables in reweight_entity.
>
> Since there is not scope on using a different and signed type,
> this change improves code consistency and avoids further type
> conversions. More important, to prevent undefined behavior
> caused by overflow.
There is no undefined behaviour due to overflow. UBSAN is broken,
upgrade to GCC8 or later.
next prev parent reply other threads:[~2019-04-15 12:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-13 3:32 Cheng Jian
2019-04-15 12:46 ` Peter Zijlstra [this message]
2019-04-15 15:20 ` chengjian (D)
2019-04-15 15:25 ` Peter Zijlstra
2019-04-15 15:50 ` chengjian (D)
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=20190415124617.GP11158@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=cj.chengjian@huawei.com \
--cc=huawei.libin@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=xiexiuqi@huawei.com \
--cc=yangyingliang@huawei.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
all inboxes | Powered by JetHome®