Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3060938rdb; Wed, 15 Nov 2023 21:16:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IErdgrmjBXs3t9zXWpadMAOi/SVRJJzZpLbaHJqtRa6xD/1gz7Ry80cKYMeAk68p6WWbS3B X-Received: by 2002:a05:6a20:8408:b0:180:f9c4:a796 with SMTP id c8-20020a056a20840800b00180f9c4a796mr14032547pzd.54.1700111815686; Wed, 15 Nov 2023 21:16:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700111815; cv=none; d=google.com; s=arc-20160816; b=pdxJvjmu9hP35ttevwilBmdolOJzIxZQ9dzfkW7T3UAtYh/yjCrmkbm1ODFSPal8mz sSm8RcsDZGe/+sdi0Y1+5j7f4d6R3n+ALHrgUSZ2ckCHRnv40QpdCyvyQoEy4rPgYoC4 7KBidFatcY/woCN5fEZg0DSdyeYp0FnY/krlFYl5QmIkHpHWn7qmZOWNp86bp3XcpK9d o7IxQOVGp0oPTtNCMrqw6hDJszIxnrRQCriJYYrbw2k566+3aMzqyjBQn84yS8INuaK5 PwPg1VgZvGPCZSx8bFJNl5UMwumD+IGWtGqs/kgNDdLo/9bdHByu7nMJ05C+C/+7XOjx OOEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:message-id; bh=8j/xxx3Ow28uXIiT4hsoM+04dPycL4vVSYm73xYPFAY=; fh=jyhFGwMdrQYdQ1gnNERUBwoVWoMaUKowoEMziUleRjs=; b=tFBX8jLihaUXsINscFa4DC4KNrBBg2zRh90vSCiES11sdVa5qtf3fRuYldDuxrqWH6 r3IxIEkY09Uy5IrdeDD+VNDvSdP3rq0WGuXyuOuL2QzzuAZPa0aNxQ46Qc99w8vD5mrL TBIB2DUYoTWwwZnnPh56uYkBDqDJjLW+xXorT+13rTG4ZMN/VI4QfO4wTzqrUByfFgTo JL3eLFEeIpwfoWtaJVWTBYi/G0bb6aDBZpHT1LKRtD4b63pGkhsyyTJ81Q5IKZXmPdwS eJwDEs0hKZEBQY+LzkbqshE5BQyx/vLHP5Di6JbpvNt2ozqDJjbx0AY36jHmF+JEtvJM rXCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fV8F4q5t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id ls11-20020a17090b350b00b0028065b30a0dsi1229889pjb.124.2023.11.15.21.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 21:16:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fV8F4q5t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6E703801CCE5; Wed, 15 Nov 2023 21:16:53 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230236AbjKPFQs (ORCPT + 99 others); Thu, 16 Nov 2023 00:16:48 -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 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 15 Nov 2023 21:16:53 -0800 (PST) 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