From mboxrd@z Thu Jan 1 00:00:00 1970 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 3FC05C197A0 for ; Thu, 16 Nov 2023 05:16:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343892AbjKPFQt (ORCPT ); Thu, 16 Nov 2023 00:16:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbjKPFQr (ORCPT ); Thu, 16 Nov 2023 00:16:47 -0500 X-Greylist: delayed 7361 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 15 Nov 2023 21:16:43 PST Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E39BEA9 for ; Wed, 15 Nov 2023 21:16:43 -0800 (PST) Message-ID: <9dfbc7ce-49cc-4519-88cf-93d6b72e5ff6@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1700111801; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8j/xxx3Ow28uXIiT4hsoM+04dPycL4vVSYm73xYPFAY=; b=fV8F4q5t5hh7h24d7bU0o1bWZTS+MOK3/tAqiXgt6+mjZcrfemOPyZm0/LFrj0kBgHBOwO WbfkagNrdf2dXoLdRs3vTYLtccXBLcCCn56fMBmJiiA0DxTh35FRzHW4ecXYWhOTL02HwF gh6NzQAnUeoOuHAQhyXidtXLYVLM9LU= Date: Thu, 16 Nov 2023 00:16:34 -0500 MIME-Version: 1.0 Subject: Re: [PATCH 3/3] bpf: bpf_iter_task_next: use next_task(kit->task) rather than next_task(kit->pos) Content-Language: en-GB To: Oleg Nesterov , Alexei Starovoitov Cc: Chuyi Zhou , Daniel Borkmann , Kui-Feng Lee , linux-kernel@vger.kernel.org, bpf@vger.kernel.org References: <20231114163239.GA903@redhat.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: <20231114163239.GA903@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/14/23 11:32 AM, Oleg Nesterov wrote: > This looks more clear and simplifies the code. While at it, remove the > unnecessary initialization of pos/task at the start of bpf_iter_task_new(). > > Note that we can even kill kit->task, we can just use pos->group_leader, > but I don't understand the BUILD_BUG_ON() checks in bpf_iter_task_new(). Let us keep kit->task, which is used in later function bpf_iter_task_next(). The patch looks good to me. > > Signed-off-by: Oleg Nesterov Acked-by: Yonghong Song