Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2135090yba; Mon, 15 Apr 2019 05:47:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpAmfF00eYR5bpTJBpz+Z46FO2uNDVZDYzSK0501kNTcT7TDjmrzDhEPU2p0uXIBQLiCVf X-Received: by 2002:a17:902:121:: with SMTP id 30mr40546298plb.174.1555332438513; Mon, 15 Apr 2019 05:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555332438; cv=none; d=google.com; s=arc-20160816; b=oQYB6i+FKjNmy1qTKyhZcaPqOzhbzWvOLK/Ii0syFaqeG63sfoaHUSizhzbtQ+uMFv 1salMF0+CEH6xW3hWC3owiGwUGlT0Kydb7sQ0j2kZUcASvHBSB9OD/ftllbor3BNyN/A j3zD/f7MZaDAha7yYwcAvKhskE9l8eSKOPbgd/804aJexAGYrWzLjqNe7pPiTVcrSCM6 PiAyseNIeiqkXBU11DIqyEiEGUaBUVyoXU7Dfk8B2TxfmvPzZicj05wn9yGHH/e7QuJ+ X+hhmAeSSKU+OQ6n8xxHir61XMy3oON4+vjGFBo9HX8Xqbur30BDoH1ekmLUZ6FHLT/O 2eoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YNMB8U0jsVuYMHRIrnpj6p3QotqRN11Np57Z/trdroM=; b=0qZp6nJZK2kAwPfBhWxy6PcJTzpqvJWRH1w9gYXczHDN4b4MxXVjGuybSrz15hs7Rt Zrs/Wtr3XqUwH0GRos6upHfWrwtBqUaTnUB36GhEUQurf7YeKgoFa4XBonVmTG5tpd1m yeVFskvIQVh+1R0DhscIVm0Izei0wlGb5pEqQkLYp2UXc6Z6uiItI6RD732Wl6WlsQiP bFW2hSwJttrPi6yx0uTIlztqEU6rQrGXw4NFTHp7aSd8eDWAbh5fMt7FqrJeE3z6sR1/ NdbYCc/GnsrfoqPZRWzFqkf6IYxl/6XTZ+CVu6BCjc0T1PBIr2N+BF+fo58SmYWbz+e9 nPuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=X2sL0cDV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15si45861508pgj.126.2019.04.15.05.47.01; Mon, 15 Apr 2019 05:47:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=X2sL0cDV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727414AbfDOMqZ (ORCPT + 99 others); Mon, 15 Apr 2019 08:46:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38102 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726042AbfDOMqZ (ORCPT ); Mon, 15 Apr 2019 08:46:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=YNMB8U0jsVuYMHRIrnpj6p3QotqRN11Np57Z/trdroM=; b=X2sL0cDVYLOuWe5PRv3ClFlN+ DnVhWUr7Iye0aKnOirRVc+x+8QUB6es515/9jCuskITTPSceyRyU1jNHogb0d/ZiKmSV16CDXYchL ob6DKJ+ZxXRes9Lklv+MhAA2pJEAYoQgZB0nkfUJQJCdyHlesW9dogoi0MparPTaD31vUpP+HOgls 4NPON+zIko3E+eLaiaQwZRQkyDcKtu8YjwZUeA8U4NOAmj3Ic/4fcn+d0y5cenrGlwgmQyHYH25Qe BL/r8+FZolB4isq9coOc7yWHMTHH0gkPBDGYkRYgDToIAA8eOJUd0jGbwob300H+jmIlrEkzS4grK hDGWjoGdw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hG106-0002JJ-RR; Mon, 15 Apr 2019 12:46:19 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 35E4528B6D259; Mon, 15 Apr 2019 14:46:17 +0200 (CEST) Date: Mon, 15 Apr 2019 14:46:17 +0200 From: Peter Zijlstra To: Cheng Jian 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 Message-ID: <20190415124617.GP11158@hirez.programming.kicks-ass.net> References: <20190413033234.30002-1-cj.chengjian@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190413033234.30002-1-cj.chengjian@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.