Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp751941pxj; Wed, 2 Jun 2021 10:29:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz385LM7V5GP6ggR/IqBp+REQtY3BlEBZouGZQgoE68Wrt1XXP46Nw12To30FmQLLpSFXmH X-Received: by 2002:a17:906:63d2:: with SMTP id u18mr35069332ejk.186.1622654949766; Wed, 02 Jun 2021 10:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622654949; cv=none; d=google.com; s=arc-20160816; b=xatFpysjY2+4ebY8PlxCV1PNZLbQjR7+anAOFej5SCnylIBRqQlVDfKxFKLn3vT4ld IFqzu0OlHLsKAuPVpK20j2XyeN5ULKTCXxw38vi1X1Q892r5oxalIdxNjaXaaXXZ1RS2 uriws55kN8nNbcIcLMX9kzdbEosD3swUUBa0i1EpyQ0RczzR3/XfBGII7Y/sDFkfjIx7 hoPJpgf6UKwK8uHrw2ZCi+hBuOQlEYz5MWAkJucZ3Nxs9SyR/6lrRnikSe0TT9xkzY/t Kf3GTOReIQ2ZV93VuZbhCIruu016eDzgq2iPO55iSHjeZzXpy44CcU2LFmVZZQl4IS2M HF4w== 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 :dkim-signature; bh=bus9d4xSX8efrj+E6YTRi08vl1mH8eg05+BsiHoWsKg=; b=nVWwMj7Jivj5jrx6bL+N0Y44lXRv4BpMy2v/UPLj/GSDpKiP0k+Zadny+TVNErGGps T4JMRaU8MtEcdb5hO0lmcb1W3J50QO/v5k/iQNWlfUq3j5px1fWSGb/8DGbDQnqiGMaz z2ojhYjtDEgy8skP0sE7+8ueqQpCR5V7hT+cT/jw3egpNr45Tlxi9/gB5SBBX/7QFOKr E91FckO/XL27X00rNIz0FUBYd3MDRXYxIKVwpy6aidAvhv34zEtGa96cOCgFQkHNuwE+ za64+4n8DN2orIxkM6D2+zK0lJCAxNvnBto3/ppcKA2Pu8CWi/mOtuMH1736nZrbKrrr BQjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IhTSPvX1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n10si408554ejk.556.2021.06.02.10.28.47; Wed, 02 Jun 2021 10:29:09 -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=@kernel.org header.s=k20201202 header.b=IhTSPvX1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230340AbhFBR15 (ORCPT + 99 others); Wed, 2 Jun 2021 13:27:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbhFBR1x (ORCPT ); Wed, 2 Jun 2021 13:27:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6928761CFF; Wed, 2 Jun 2021 17:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622654769; bh=4TdZWdT458pa+A30aTCE5yanC9JhHWs29JrnvdhvEsk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IhTSPvX1oFWdhWHvPOOW2s4vlB00wzTN1wE2o6r5VK+9bObXTr3LC66LEhfIOILVO OnXKWk9q28SQcFDyatOCgQyYUvVKL2himBVOIot23PfZWFuvevCSHoynsZiObqRgAw UrIBVx+ZKiQ8k57gL/06h7pv75aF5KJW3I4nAnhPcFfbb7VAb5ksGBZd0Z4WX0YpdQ jle8X/mqbZQQsDxn+kOwfTuCM5pHOLsk0jT230v0xX9tId75Q3+AtpOw+74b1mnE3B 7mlYEE1W96v5qY6Z3urtZDUFNTejlhORoonbDlImg3Dch0yZ73lAs54uxlK/8M3oA7 9oBvlXvUhEVTw== Date: Wed, 2 Jun 2021 18:26:04 +0100 From: Will Deacon To: "Xu, Yanfei" Cc: Daniel Borkmann , ast@kernel.org, zlim.lnx@gmail.com, catalin.marinas@arm.com, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] bpf: avoid unnecessary IPI in bpf_flush_icache Message-ID: <20210602172603.GB31957@willie-the-truck> References: <20210601150625.37419-1-yanfei.xu@windriver.com> <20210601150625.37419-2-yanfei.xu@windriver.com> <56cc1e25-25c3-a3da-64e3-8a1c539d685b@iogearbox.net> <20210601174114.GA29130@willie-the-truck> <7637dcdf-12b4-2861-3c76-f8a8e240a05e@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7637dcdf-12b4-2861-3c76-f8a8e240a05e@windriver.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 02, 2021 at 07:26:03PM +0800, Xu, Yanfei wrote: > > > On 6/2/21 1:41 AM, Will Deacon wrote: > > [Please note: This e-mail is from an EXTERNAL e-mail address] > > > > On Tue, Jun 01, 2021 at 07:20:04PM +0200, Daniel Borkmann wrote: > > > On 6/1/21 5:06 PM, Yanfei Xu wrote: > > > > It's no need to trigger IPI for keeping pipeline fresh in bpf case. > > > > > > This needs a more concrete explanation/analysis on "why it is safe" to do so > > > rather than just saying that it is not needed. > > > > Agreed. You need to show how the executing thread ends up going through a > > context synchronizing operation before jumping to the generated code if > > the IPI here is removed. > > This patch came out with I looked through ftrace codes. Ftrace modify > the text code and don't send IPI in aarch64_insn_patch_text_nosync(). I > mistakenly thought the bpf is same with ftrace. > > But now I'm still not sure why the ftrace don't need the IPI to go > through context synchronizing, maybe the worst situation is omit a > tracing event? I think ftrace handles this itself via ftrace_sync_ipi, no? Will