Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3159844rdb; Thu, 16 Nov 2023 01:40:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IErzU4m/FkbIi4tZMu+8YGUIbSWUZU0iczZclPRWHhFgVMu6SbHjDZwc8pPEua4FFSw0Swd X-Received: by 2002:a17:90b:224f:b0:281:554d:b318 with SMTP id hk15-20020a17090b224f00b00281554db318mr12315940pjb.39.1700127652400; Thu, 16 Nov 2023 01:40:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700127652; cv=none; d=google.com; s=arc-20160816; b=0A/yjPbB0y+bv1EzW3fYh8Ey1XtkZ3LQxPfLCIdOovKJuXsQev/EQWqokuZdIyfDyX NH4413hzYcpf58izIX0n3wEtLinmuS1/KTD8b/e8YI7BqSS1MpPU+ujHbBUBI/05aS07 j01mT5vZcc2Degbu6jYrh0Y0rJhtUpDihiBKTssMKF3GCDAzwe7/MB3qIGaswtQ1XVEJ 5G+2FGQWrR+6NgMLVRfhPo6G2BtXOrDCkCwRFc72KZgbfZa6TGAmz98t/jJ518Tc+HuJ Se5a+61jUnlBJnzJtBO4D6dE6ihLJBSFN6VznuJsRs5+ODxDwhFUlfCLmq993ydc4uoA muew== 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=LLXIUTXD0M2uVOySxASo8TWbR7mxoyT6p6/agsN7zes=; fh=jyfu6Gueau3713nNQpgKwQg1G+5GHUHGswwrNlciNQ0=; b=iTBt7iX4L3Ea08QubwuJH62MSjEW7TniU3NPx6PyjC4Re7XGVdTgxhDoSGuclQKe/U PebYY8CwzLEo3pGe4mX3rZ1S/ancQl0xHCeOYhVnTPMApUi9z8VSAs+nafqaocWBdeLm t7W4Y5FrJlVHhV0eVRqqbv6WBn3FaoZ4CpU5s5Dk2GfZ6mkjNtXsM+YTXlQuqVPYTRz+ LvBfoQDvR5M7OGJfZC0CUDLXEbyHUiVtPyvSa0BVnfFWSi1K87t+FeMdoWGfYDGSmjzu T6deCjijW1VJxqAKqwq2YzdKyqjSx8wsWahAMAE0vyme/9o9euV3+Xj86MoVHQIjQWKm 3iRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fSKx9Y9V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id g5-20020a17090ace8500b00276bdabe471si1634280pju.163.2023.11.16.01.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 01:40:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fSKx9Y9V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 5071A8083E70; Thu, 16 Nov 2023 01:40:13 -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 S230254AbjKPJkF (ORCPT + 99 others); Thu, 16 Nov 2023 04:40:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjKPJkD (ORCPT ); Thu, 16 Nov 2023 04:40:03 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC3AD101 for ; Thu, 16 Nov 2023 01:40:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700127599; 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: in-reply-to:in-reply-to:references:references; bh=LLXIUTXD0M2uVOySxASo8TWbR7mxoyT6p6/agsN7zes=; b=fSKx9Y9Vpew2O9f6R9sjyayhbjx/P8KzYvizrfQ6RmcWgvc5dSjH1simT+0xsS8eqKg5px svqLdWugLwZ3DZbQesuENDa3AIHm9S+FuJHSJTR7VGtBTJP65BwDscG3E9nqFVqyYebPdy 2+maN+mKVU33ZKwzrnxZKnzQUFkF/U4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-426--r7ZKUlaPpu-Zo4m0k70mA-1; Thu, 16 Nov 2023 04:39:55 -0500 X-MC-Unique: -r7ZKUlaPpu-Zo4m0k70mA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 39F783C11C66; Thu, 16 Nov 2023 09:39:55 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.23]) by smtp.corp.redhat.com (Postfix) with SMTP id 5C859492BFD; Thu, 16 Nov 2023 09:39:53 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 16 Nov 2023 10:38:51 +0100 (CET) Date: Thu, 16 Nov 2023 10:38:48 +0100 From: Oleg Nesterov To: Yonghong Song Cc: Alexei Starovoitov , Chuyi Zhou , Daniel Borkmann , Kui-Feng Lee , linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH 3/3] bpf: bpf_iter_task_next: use next_task(kit->task) rather than next_task(kit->pos) Message-ID: <20231116093848.GB18748@redhat.com> References: <20231114163239.GA903@redhat.com> <9dfbc7ce-49cc-4519-88cf-93d6b72e5ff6@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9dfbc7ce-49cc-4519-88cf-93d6b72e5ff6@linux.dev> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_HIGH,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]); Thu, 16 Nov 2023 01:40:13 -0800 (PST) On 11/16, Yonghong Song wrote: > > 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. Yes, but it can use pos->group_leader instead of kit->task. But I agree, lets keep kit->task. > Acked-by: Yonghong Song Thanks! Oleg.