Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3079C64EC4 for ; Wed, 8 Mar 2023 16:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232433AbjCHQFY (ORCPT ); Wed, 8 Mar 2023 11:05:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232558AbjCHQE7 (ORCPT ); Wed, 8 Mar 2023 11:04:59 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07FF25DC8F; Wed, 8 Mar 2023 08:03:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EL4qrX80+IzwotJuYRLFPEqurDdxAU1RtynFNr+MRVPcQ3Dq0paMFZQe49mXLUBQE1KZslG1CkoftemlH49GvXLvboFtKYvOoyX63GMfYWRD9vqV5J+4HZqZlO554uuzpSMby/PkymXIfPOxaFYMVamfCj1uUdEH98u6g3f9x0jkM9+e8pJlBavATgJv9a4Qu35fGdH+mLxLnaV3UF/RrwGURBMOq5ogD2ZWlVjph4V35KT0hrK3cBTVKvX+A26C2CFgzJ/rdsc9Bq17w3jDLm+ZwWuReImo44R4PyiLhWTa3bZ1Z3++bbfMheWEfSpy5nd2EMqczHGrKPVH7z/BWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N9AGUcK5MuBtP+SG50Bllt7QAbfXch7CBg9zdu8mdVk=; b=NP1YrA6ridyhq1li9/HnNSYN+YqVFrM0H5veKV5KKNtjWSg4VWhIiXNYhUFOkCallfSrC9qLxlbVd4FHftNv4uS7QBYVa4ZnVbDk+vwf8GaIJeiv7GKR77mfm7cYgxZaxMPvt0240WsICzG9NBG0qZmYOl/G+af5gLP7MhbYu5CjaJkHIHvMnPE//SpyDebKVKVhDsNpVYk/oNAOwevUgAthSWfXCwD0F3sKi5oV8Xg/PNdnuamEtxvNm7z/NbiUCSaYDALCJm5wDwxfmdKCI/Hykr2R3Bv62wMZSZGMydxXyH1CHhas2OGhNzVVx2G8T25Mg62gPt+WImbojs+uHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N9AGUcK5MuBtP+SG50Bllt7QAbfXch7CBg9zdu8mdVk=; b=nAqJn7xxffJo0PSm/hAj55BpCuh6rW5T8FL+ePfuyBkZXtpqCL87gBHmwKfpqCroiGxtMNz2plqYd7rTOSMt0WUXVKidCRA7V36Rpkrs1jkcjVGDjyekBlVQ6ZHZ/oyNx+m+CsaCBduGlEATGG28rkKdvmjM9OLDmJcZi9MaAoU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) by DS0PR12MB8365.namprd12.prod.outlook.com (2603:10b6:8:f8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18; Wed, 8 Mar 2023 16:02:51 +0000 Received: from MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::3490:de56:de08:46f6]) by MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::3490:de56:de08:46f6%9]) with mapi id 15.20.6156.029; Wed, 8 Mar 2023 16:02:50 +0000 Message-ID: Date: Wed, 8 Mar 2023 10:02:46 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Reply-To: babu.moger@amd.com Subject: Re: [PATCH] x86/resctrl: avoid compiler optimization in __resctrl_sched_in To: Linus Torvalds , Jakub Jelinek Cc: Segher Boessenkool , Peter Zijlstra , Nick Desaulniers , Stephane Eranian , linux-kernel@vger.kernel.org, tony.luck@intel.com, reinette.chatre@intel.com, fenghua.yu@intel.com, peternewman@google.com, james.morse@arm.com, ananth.narayan@amd.com, vschneid@redhat.com, Nathan Chancellor , clang-built-linux , Borislav Petkov , "H. Peter Anvin" , linux-toolchains@vger.kernel.org References: <20230303231133.1486085-1-eranian@google.com> <20230306120106.GE1267364@hirez.programming.kicks-ass.net> <20230307113545.GB2017917@hirez.programming.kicks-ass.net> <20230307184315.GS25951@gate.crashing.org> Content-Language: en-US From: "Moger, Babu" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: CH2PR19CA0015.namprd19.prod.outlook.com (2603:10b6:610:4d::25) To MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW3PR12MB4553:EE_|DS0PR12MB8365:EE_ X-MS-Office365-Filtering-Correlation-Id: 6511e380-da33-4ed6-bc10-08db1fee9146 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pZOMNbQ2ma0e6fFlmndDxO707tLPKOTQdA35qoMiygpLfrBsZ1zuGj8S5La/CLEo3GJnZVWRBhTLHuoIzwGnUN4nQ5L1Wt5VwMnNbOZ57BIlRC7mHc0yStkLtQJmqfcDMO+dieA55oJuI5bB9NUjxlM6i6zqEmjUFZyxweJRlZa0VD+yNUPi2oKKhgKv7OKMB6ti7S8gq2FO/fFia3F2ujMInpt9i01zhCPMeI42ZLNL+7DUgPK6TFY74Y1BLBq38pUDD+52K/mFYmKhUj7QJwYF14lu46CcU/nnqosh3sB6pMrlRI48s6dkW/W1OUSVofCW89mRWGzy9XJcPo21ZuFpe+QZVc5zQ64BbeM1OcXn92sn5/MryMJpwwCInMKDDj0Fhv7nmaou+pXjDnhndZNQz5UwQjS+oDPxsMpE0x36KH4kqzWTkqtGLR/X6GYZk81762BR5Kbn+0jUGgbDuvW8CCZFkmZT7ovWI/QBacv1yDnLt7sQl7TkBBJGqMgYMW6+dr5wx6iLfKQJanpVUKITeYz4XLNK988Dqxyq1Eg1g2tZJNAx9Bxw5cdBjpX0nfCn/NlObry30f2wm+cYR7S0t3GQ24PkxS7ONCOaOy7zA4qrgSTc6TnpaZ8UhiBHMabeC3eC/7V5JXvvrmMiDn6HeB0jose9XaQH0XdusAaL+HMtWshdtxw2Pm4fMpsjguZLwExLwWHTuMR+5FVDvw5qu9YPIgzRv+E1QDDm/4Y= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR12MB4553.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(451199018)(66476007)(66946007)(66556008)(316002)(41300700001)(83380400001)(8676002)(4326008)(31686004)(110136005)(54906003)(36756003)(38100700002)(8936002)(4744005)(2906002)(186003)(5660300002)(7416002)(478600001)(2616005)(86362001)(6666004)(3450700001)(6486002)(6512007)(6506007)(26005)(53546011)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UlBRZ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ycjJIdWF4Skdi?= =?utf-8?B?MUtXaTc4ZHZMYlllVUpIUkU2QzgrOXFjanRzY0Z3SndGWXordFhRYzdwN3h3?= =?utf-8?B?czZabWRVUmtiSnlQRFU2M2FvTG1wTUphdDM4N0RmV1NzUDN6Mm5nUnhzcHJv?= =?utf-8?B?Q1pNM0l0UEhiejJpWmo2MURhMjg1MTF6V2M3OG5TK2FUR1ViUWZMUSt5YktD?= =?utf-8?B?ZjZIR2dNaEM2RmZWSEpIcGhqQzROMlUzSlNHZ1hGZjg4ZFRaOTlBbVg2YlEz?= =?utf-8?B?b29mME5WdEUrRHA5WDlSOXQ4NFp5U0E0cWpQOTBEdlVZcjh0dWVrb09qaFQ4?= =?utf-8?Q?WO6M61lh3Ectg8B/pIUeSp7hx?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6511e380-da33-4ed6-bc10-08db1fee9146 X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4553.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2023 16:02:50.5546 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FDzBaRPmJlh82qkW+omYO770weMx4XJ/JO8IMcPr6pmaADWmv1r8u31Q+xOaoV/u X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8365 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/7/23 15:06, Linus Torvalds wrote: > On Tue, Mar 7, 2023 at 12:54 PM Linus Torvalds > wrote: >> >> I think the problem is that the code is disgusting and >> horrible in multiple ways: >> >> (a) it shouldn't define and declare a static function in a header file >> >> (b) the resctrl_sched_in() inline function is misdesigned to begin with > > Ok, so here's a *ttoally* untested and mindless patch to maybe fix > what I dislike about that resctl code. > > Does it fix the code generation issue? I have no idea. But this is > what I would suggest is the right answer, without actually knowing the > code any better, and just going on a mindless rampage. > > It seems to compile for me, fwiw. > > Linus Tested both on GCC and CLANG. Test passes and resctrl limits are working fine. Thanks for the patch. Tested-by: Babu Moger -- Thanks Babu Moger