Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp264049yba; Thu, 18 Apr 2019 00:29:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxl6AGcuF54AH+Z3zkW31thhQTw2fK7TAKU3AsjFkkXfpEpvR6GX/Zm8agxycIAZpVuUfGr X-Received: by 2002:a62:2a97:: with SMTP id q145mr94579215pfq.22.1555572597702; Thu, 18 Apr 2019 00:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555572597; cv=none; d=google.com; s=arc-20160816; b=NmO3ivV6QotXW8KLmap3Bi/DUbaYYlH3qfsOZdq+nJ1evCgYOYa716j9UqTgHVfuSR lPuODOd2e5mVGyzGK5IWjmcgZQaVPwEbO+XoVIm2rMGAsX3iSI/itBJrgew2FDY/pPJP AAnCFbDAaaQ8X77x5LUFb1yFHmB+oJaxMzR70AZ0b0BUmG+m0e1IGOrRteAsJUo1qlev LNfTIwM6tF43iRYgh2duhsMZ7o4jzp0k5ZUWT4UWI2bzXw2FBydBo5ry+Q9tl/fb1mMW /j7oADGnbxwgUyyUHhb91UDZkN7rzde44XnnzVbnKwsT0KINivFXOuQoJzLBh0iQa7oR Sdfw== 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=mDXcmB2dg3VfgT/wN632ae9RcHNXHqZMTaZd4Y5RGjc=; b=GKSk0GyJrfo0vmUT2IW1Apl6ITAdmRJEG8/YsXY0gsGuva0JYbdSd82n3wVXTZBNDT VUr2O4oTz8Hry1wq2Jvqp019S7JAtzwJai8Vsu4VW/Slw3I1/+Yn2N+dfdOrzVSczq7b asSdnSTafxdk4+fsqjWu6gm9pazuq/UI7tNxFYV6XnFfyrlWgq4CZgldNay7DojVhl4R 2fO/l4ZH6Ev38Bz/Dgeb0DVnQtTz2bin3iR0SUwuPgXlK8fRyF7mpK36E5iXucEPoSY5 GGUiE0KGhogWmHhRtKMlia0G1zsQfMp8+sj0pZshsDOiImg23YW3Rd85vbMwMf9KHMFq 1oDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=PMN9oRU0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n12si1369256plp.223.2019.04.18.00.29.42; Thu, 18 Apr 2019 00:29:57 -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=pass header.i=@alien8.de header.s=dkim header.b=PMN9oRU0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388097AbfDRH2x (ORCPT + 99 others); Thu, 18 Apr 2019 03:28:53 -0400 Received: from mail.skyhub.de ([5.9.137.197]:54440 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730258AbfDRH2w (ORCPT ); Thu, 18 Apr 2019 03:28:52 -0400 Received: from zn.tnic (p200300EC2F112E00DC490119D3A149FB.dip0.t-ipconnect.de [IPv6:2003:ec:2f11:2e00:dc49:119:d3a1:49fb]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 59E731EC0104; Thu, 18 Apr 2019 09:28:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1555572531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=mDXcmB2dg3VfgT/wN632ae9RcHNXHqZMTaZd4Y5RGjc=; b=PMN9oRU0eLY15i7KvvZB20GQGIYzACtH0qXyHtwcN5dycDTftuUW5AuZsD2laIzPtKSWlE cIcK3Wp5V3cMuq9EnGABXMSIZopvrFEGtwv1/YeXcCkvR/jjBM5XOhmzNmdt/dFePAiMEC ZVhoQGeELsLSiDUiqF7Fs5+p3lH12i4= Date: Thu, 18 Apr 2019 09:28:46 +0200 From: Borislav Petkov To: Xiaochen Shen Cc: tony.luck@intel.com, x86@kernel.org, mingo@redhat.com, bp@suse.de, reinette.chatre@intel.com, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, fenghua.yu@intel.com, linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/cache] x86/resctrl: Initialize a new resource group with default MBA values Message-ID: <20190418072845.GA27160@zn.tnic> References: <1555499329-1170-3-git-send-email-xiaochen.shen@intel.com> <0ab6a79f-d1ae-1c99-1447-722f18405309@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0ab6a79f-d1ae-1c99-1447-722f18405309@intel.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 Thu, Apr 18, 2019 at 03:03:35PM +0800, Xiaochen Shen wrote: > In my opinion, this newline is unnecessary. Thank you. See commit message: > [ bp: Add newlines between code blocks for better readability. ] And I didn't add enough. That code is too crammed. For example, the new __init_one_rdt_domain() could use some newlines too, to separate code blocks for better readability. At least before each comment so that one can visually distinguish code groups better/faster. Here the whole function pasted with newlines added where I think they make sense. This way you have visual separation between the code blocks and not one big fat clump of code which one has to painstakingly pick apart. static int __init_one_rdt_domain(struct rdt_domain *d, struct rdt_resource *r, u32 closid) { struct rdt_resource *r_cdp = NULL; struct rdt_domain *d_cdp = NULL; u32 used_b = 0, unused_b = 0; unsigned long tmp_cbm; enum rdtgrp_mode mode; u32 peer_ctl, *ctrl; int i; rdt_cdp_peer_get(r, d, &r_cdp, &d_cdp); d->have_new_ctrl = false; d->new_ctrl = r->cache.shareable_bits; used_b = r->cache.shareable_bits; ctrl = d->ctrl_val; for (i = 0; i < closids_supported(); i++, ctrl++) { if (closid_allocated(i) && i != closid) { mode = rdtgroup_mode_by_closid(i); if (mode == RDT_MODE_PSEUDO_LOCKSETUP) break; /* * If CDP is active include peer domain's * usage to ensure there is no overlap * with an exclusive group. */ if (d_cdp) peer_ctl = d_cdp->ctrl_val[i]; else peer_ctl = 0; used_b |= *ctrl | peer_ctl; if (mode == RDT_MODE_SHAREABLE) d->new_ctrl |= *ctrl | peer_ctl; } } if (d->plr && d->plr->cbm > 0) used_b |= d->plr->cbm; unused_b = used_b ^ (BIT_MASK(r->cache.cbm_len) - 1); unused_b &= BIT_MASK(r->cache.cbm_len) - 1; d->new_ctrl |= unused_b; /* * Force the initial CBM to be valid, user can * modify the CBM based on system availability. */ cbm_ensure_valid(&d->new_ctrl, r); /* * Assign the u32 CBM to an unsigned long to ensure that * bitmap_weight() does not access out-of-bound memory. */ tmp_cbm = d->new_ctrl; if (bitmap_weight(&tmp_cbm, r->cache.cbm_len) < r->cache.min_cbm_bits) { rdt_last_cmd_printf("No space on %s:%d\n", r->name, d->id); return -ENOSPC; } d->have_new_ctrl = true; return 0; } -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.