Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2156598pxf; Sat, 13 Mar 2021 09:31:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxS4xF81HObOxV5UHVPuHwrFU1rI7rAv1/nr34c7vomA3YCGAMTExXu3L2kYPb0IPYPzknP X-Received: by 2002:a17:906:9bc5:: with SMTP id de5mr15040910ejc.284.1615656701033; Sat, 13 Mar 2021 09:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615656701; cv=none; d=google.com; s=arc-20160816; b=x4Dsqm9xD7tOC/Km4tubJHphiqKMf9AYO8t+qRFLEq5vISRiO+mrhBbNZtvhTHZwM0 TeDJRX4FUV/GCa13xjHjGya8ziYh6A+K/FDkyngAUI4ZTU+BhaQRghDlTcgfcLMNOQ5I qVWoRAQj5VkMAXGpkowD61yT3qehk2Y+BsHul+EvVX/VQhD+nV6b1cyduuVEptEisr90 IAbMD4FLVDcSykM55gLMV2SCy9H3fOpJ/ri9p7BU2thzy9XT9H2ZERYRm7GrDhj76ssK D+h27LvUBPALHkimIJQ4zZ3BXxosMH//5leSP3HoV0yht4bzsqOJYkdlzlmEeDiB7+pU mmKw== 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=ZHzgzyz05IVQ249p/UoEccGI5UagydHjlQL2rKeWqxI=; b=A/gEbjrQMcECwcrzbSqhKm93ymakCtnYnE5ic0MFx3QpW89bxL2S/6yCocN2BG10m5 +mLWfP3tAzbvJJS0LbTGbXOPacuFN89JnqTUE/q1FiTP61WZlq3yIQzTZwmOtQfDQr+0 R4cuX4ZBcLSaoTf47U06HAKftaQxNwVZDB2KAd+RQvj+/1rp1zNTmZ+zZM4fsLp8p1hO AtyyCmTZ0L5LZx1Vot0Sfw9NU/AoLnzaom1LXqVTOgg6SVam1ZplVKLTNDsVTqhwidzo lMdanoy3NubT4R3sOJXndKO7d94Bfa99vlt0/XqdaJffrI8OlqpqMu4V156B2404Rhek pTag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OarQdu0k; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si6481160edr.457.2021.03.13.09.31.18; Sat, 13 Mar 2021 09:31:41 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=OarQdu0k; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234147AbhCMRZz (ORCPT + 99 others); Sat, 13 Mar 2021 12:25:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39964 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233635AbhCMRZo (ORCPT ); Sat, 13 Mar 2021 12:25:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615656343; 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=ZHzgzyz05IVQ249p/UoEccGI5UagydHjlQL2rKeWqxI=; b=OarQdu0kH7p0/0zAvXDF/KlriBgEbiC3mYnGtPfnsXKY+1ePTG+GH6wmenAVjsGgmFG2XF n3eB47BFfMxJnOkj0ZFwpZVIZhJzj1cbZStwrmWKUx3tYQyRZfVviM75/6MagO2MqTvakb R8YYa3eDPfReUTgyVi00QvKOsIfTu14= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-589-yGXm4AQ-PwuZEQHpn2PvTg-1; Sat, 13 Mar 2021 12:25:39 -0500 X-MC-Unique: yGXm4AQ-PwuZEQHpn2PvTg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E647A100B3AB; Sat, 13 Mar 2021 17:25:37 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.35]) by smtp.corp.redhat.com (Postfix) with SMTP id 5D7DF5D9C0; Sat, 13 Mar 2021 17:25:36 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sat, 13 Mar 2021 18:25:37 +0100 (CET) Date: Sat, 13 Mar 2021 18:25:35 +0100 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Jim Newsome , Andrew Morton , Christian Brauner , linux-kernel@vger.kernel.org Subject: Re: [PATCH v5] do_wait: make PIDTYPE_PID case O(1) instead of O(n) Message-ID: <20210313172534.GA3588@redhat.com> References: <20210312173855.24843-1-jnewsome@torproject.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/12, Eric W. Biederman wrote: > > I am going to kibitz just a little bit more. > > When I looked at this a second time it became apparent that using > pid_task twice should actually be faster as it removes a dependent load > caused by thread_group_leader, and replaces it by accessing two adjacent > pointers in the same cache line. Heh, I think this code should be optimized for the reader in the first place ;) But as I said I won't argue, readability is very subjective, I am fine with your version too. Oleg.