From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0A7D1487E4 for ; Fri, 12 Apr 2024 16:13:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712938411; cv=none; b=GTj2Adcbv0L/uEPZ+d0bjVNqE5k5HoGqIR/Kvvg5xrZ7hXDCGquC8pSmXTQDUKCN2ZTxCoiV5eLznOQmikEAn+e/j0byDjlnXRVkZIybB5wzMQqp+NSWWf2wKijG+oLopWTsTwMMg7Xf3Lzu/EEXbHTAIyfe+A1JZe+Y26gsLOs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712938411; c=relaxed/simple; bh=Q4V6Zn9TStSChaSxBLObNVv7hgA1ULUGeyWgeYmigkY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rtCbdldEl3II2Zp8m+4HzE3t3LpViZlZEeZtM3ISQYV66n9WP7tFQOoj6O1a4kiLZRcUCcu2IHHwDUDFNAZsXM7gLuohgdQbWyfa5sF5vR7QtsiIE/wWXUw/zIGhrmZy9ePIDfmI+J8Z4oafAxwZU7td4D96b8f/6FrRcHO1ofo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 255B0339; Fri, 12 Apr 2024 09:13:58 -0700 (PDT) Received: from e133380.arm.com (e133380.arm.com [10.1.197.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 340723F64C; Fri, 12 Apr 2024 09:13:26 -0700 (PDT) Date: Fri, 12 Apr 2024 17:13:23 +0100 From: Dave Martin To: David Hildenbrand Cc: James Morse , x86@kernel.org, linux-kernel@vger.kernel.org, Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, Rex Nie Subject: Re: [PATCH v1 03/31] x86/resctrl: Move ctrlval string parsing policy away from the arch code Message-ID: References: <20240321165106.31602-1-james.morse@arm.com> <20240321165106.31602-4-james.morse@arm.com> <1776b49b-3c0e-41a7-bbc5-19310c428429@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1776b49b-3c0e-41a7-bbc5-19310c428429@redhat.com> Hi, On Tue, Apr 09, 2024 at 05:13:01PM +0200, David Hildenbrand wrote: [...] > > @@ -195,6 +204,14 @@ int parse_cbm(struct rdt_parse_data *data, struct resctrl_schema *s, > > return 0; > > } > > +static ctrlval_parser_t *get_parser(struct rdt_resource *res) > > +{ > > + if (res->fflags & RFTYPE_RES_CACHE) > > + return &parse_cbm; > > + else > > + return &parse_bw; > > +} > > Besides what Reinette said, I'd have added here something that would fire in > case someone adds something unexpected in the future, like > > WARN_ON_ONCE(!(res->fflags & (RFTYPE_RES_CACHE|RFTYPE_RES_MB)); > > At the beginning of the function. > > > Apart from that, nothing jumped at me. > > -- > Cheers, > > David / dhildenb > Thanks for that -- I guess that would benefit from discussion; please see my reply to Reinette on this patch. Cheers ---Dave