Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp134152pxk; Tue, 22 Sep 2020 21:41:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyHxrDZQD+4GsFGY6MJrIqkuRQWAnZXs9u9lduCjnIO3/kPdjNxntLyWmWBBwerVHg1Mhf X-Received: by 2002:aa7:c61a:: with SMTP id h26mr7540753edq.254.1600836063833; Tue, 22 Sep 2020 21:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600836063; cv=none; d=google.com; s=arc-20160816; b=Aj0f1cJeCKSSwTV/iTAj9a2DNbNJvKIBVfedhLMc/zkmDjwG6BIZeIP4v7HDGk/UJ9 BW6tQhPl8zttQAJcmMPLFU8yXAJ+nTw9vsLO0mi1OtPA6ZPbFF3vtyJ6WvAfd1vk3KOl bLwXUm+Bkmfefl+OUN7mzAs93N2CufkkjQmnzFqjXzyKSpFTCt/Tjg1SnEBMQmbEIMy3 FFypmpoehyulvWHKC95zq7hfTMuiFvmIGzzHzlBKm0EjgsSrGH3nx2FCAqh3kWGzgoV7 3h4G4b09LTYzQIUXM80ovjtHGr0ZyKx82U1iQ2luFZpcRi7LS5RsKLoekaRpOIVsHhpv VPmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dmarc-filter:sender:dkim-signature; bh=62upVWs2yXzGE3gWPGzEaiN42HD4HHF9FHmkRd8LCPQ=; b=aI2yQ5pRK6OMG0TFe2CrDMe59AnuBJcsVpYaG9iMQ/F7mEKBjxswgrZBe6eceNj/Vi 237DGcnAjM0zBtIlm1rGfyM2Ym/5/ge4jtXuOLBiM2G2Tx+HkTKYHlDiZwMsYsiLrjaw fWccss5hLUecm0ktUmx4T5H3MYYeX++uCGfv94JWcPdQaxaAYjSCz9GXrMpbo/i9ivnC slNcxavNksXlRGI51P9hw9pV3SAC0Gpu+QQVL7J8A5KcZUu6vyZMymjLc3wbtdQtWYyv RwLpjr0Vku+HO/pL4f27Qi1C3x0lEFmG+4SqLVk0g+MpVAm1GmV1is3gaPzVVW44SL0b rqyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=IrQgHVKN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si13408003edt.499.2020.09.22.21.40.39; Tue, 22 Sep 2020 21:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=IrQgHVKN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726853AbgIWEjU (ORCPT + 99 others); Wed, 23 Sep 2020 00:39:20 -0400 Received: from z5.mailgun.us ([104.130.96.5]:26492 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbgIWEjU (ORCPT ); Wed, 23 Sep 2020 00:39:20 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1600835959; h=In-Reply-To: Content-Type: MIME-Version: References: Message-ID: Subject: Cc: To: From: Date: Sender; bh=62upVWs2yXzGE3gWPGzEaiN42HD4HHF9FHmkRd8LCPQ=; b=IrQgHVKNMtKpAEYPfAAxEpNMy69F5zxiO1uzq99vj46FRzCJKPsY4US02WmgxtzyT7m8LVdl N12Eg3KPj9ToW/dpXoxZGOS0aFfmiFFWnNDrRyqPDjvpjCuXkXWs+P/DnTuEJOJ2Qt9vp6B6 D565MvbLsfeTzF3bSKHi4VYGGdo= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-west-2.postgun.com with SMTP id 5f6ad17751ea4325f30d56c9 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 23 Sep 2020 04:39:19 GMT Sender: tingweiz=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 0EDACC43382; Wed, 23 Sep 2020 04:39:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from codeaurora.org (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tingwei) by smtp.codeaurora.org (Postfix) with ESMTPSA id 64634C433CA; Wed, 23 Sep 2020 04:39:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 64634C433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=tingweiz@codeaurora.org Date: Wed, 23 Sep 2020 12:39:07 +0800 From: Tingwei Zhang To: Alexander Shishkin Cc: Tingwei Zhang , Steven Rostedt , Ingo Molnar , Maxime Coquelin , Alexandre Torgue , tsoni@codeaurora.org, Sai Prakash Ranjan , Mathieu Poirier , Suzuki K Poulose , Mao Jinlong , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 6/6] stm class: ftrace: use different channel accroding to CPU Message-ID: <20200923043907.GA5146@codeaurora.org> References: <20200903001706.28147-1-tingwei@codeaurora.org> <20200903001706.28147-7-tingwei@codeaurora.org> <87zh5nw8vz.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zh5nw8vz.fsf@ashishki-desk.ger.corp.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 18, 2020 at 08:45:52PM +0800, Alexander Shishkin wrote: > Tingwei Zhang writes: > > > @@ -63,6 +65,7 @@ static int __init stm_ftrace_init(void) > > { > > int ret; > > > > + stm_ftrace.data.nr_chans = num_possible_cpus(); > > Not a problem with this patch necesarily, but this made me realize that > .nr_chans may be larger than: > > (1) what the policy permits, > (2) what the stm device can handle. > > While (1) the user can fix in the policy, they won't be able to fix (2), > in which case they won't be able to use stm_ftrace at all. I'm thinking > if a link-time callback would be good enough. > Hi Alex, I'm not sure if I understand this correct. If the nr_chans requested by stm_ftrace is larger than policy permits or stm device can handle, stm_assign_first_policy() returns with error so stm_source_link_add() will fail. User would notice that when link happens. There's not much we can do if resource is not enough. > Another thing is that .nr_chans needs to be a power of 2 at the moment. > I'll change to below. stm_ftrace.data.nr_chans = roundup_pow_of_two(num_possible_cpus()); > Regards, > -- > Alex > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel