Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1788019rwb; Thu, 15 Dec 2022 14:34:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXu3CB6mRBBF9rn4RVEOOkeZSv6YhsuL8PlJHlHgEJMGancO3WyjF2Zp9JhGhULb+yzQ08CJ X-Received: by 2002:a17:907:8b8c:b0:7cd:5274:151e with SMTP id tb12-20020a1709078b8c00b007cd5274151emr3358649ejc.50.1671143668407; Thu, 15 Dec 2022 14:34:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671143668; cv=none; d=google.com; s=arc-20160816; b=bVABLSgifhYs6JW7he9oZVZ2S3/wylsrIJoeMmxpDkFCbYYSTSal4Jzt0xyLM2EHt2 tmUi3MOtyLhAX6xl9V7BYtVLyNGqt5xKaetg3lR32cpSZPStzcqv3fJSMehbHJr5EiBs 2Ee8AwlU21fQM1Op1bDKIzvwJUw/OKzlXBDtY0qPButrtZTfUyCFhspSUjVJsqjUyDSo VNqH/fBM40O7fusfrNzidpMOW9U8F/0iKC9RqFfNjzPROWF3YPJCtwY0zVPMmCZC7fp4 gqpIA+rRgMJHRngKBR0KjUEuFnUyJfTjuy6TTjiuV6FhcgYF/M97ZqIrDblJxt+Wjr+l 2OPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ericO2JP21XAYQtxMKC0PuaSNwuk659UUj4IZKm+oic=; b=tG3MxZXqnoZ0fOxJfOxaN6GM2X85u29rXwFikWOUSsSN/YM/tMSvsaXeaEm/WgsDPI Z+OdQBc3y9iZbm9wb+I+eL39N/W4802yiYolCpNz4DtggqB/D4wxZTBWxoKLpfOKVIX+ 2gqJLllYUe8oNRvJJCjS9QQ1lnoK6uAZwGKluEw7yTSPV+78DIanRC/rAH7yxQuJxbO/ Bc4dShq6bVXaMhMjTwe6gczK6XlYzOiRh+0NAfEhDK3/xghKY4fM2SfyfP/Cpet1H2C2 NsdN+Zdhl2lKxvTPhE9yQGupUKHNTc+X4x3qsB4kKRdZiA8PncbExyXwNv2pwzKXP6HB EThw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=a+5wtMeg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pg20-20020a170907205400b007bc30c06aa2si287406ejb.902.2022.12.15.14.34.11; Thu, 15 Dec 2022 14:34:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=a+5wtMeg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbiLOVrK (ORCPT + 68 others); Thu, 15 Dec 2022 16:47:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbiLOVrJ (ORCPT ); Thu, 15 Dec 2022 16:47:09 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 043EB2D1E6 for ; Thu, 15 Dec 2022 13:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ericO2JP21XAYQtxMKC0PuaSNwuk659UUj4IZKm+oic=; b=a+5wtMegakJuXcj9xMnG+QwIHp fvFe0urh1FqzJjdtfIzvQSmMEZd9ADAMeg46UpRtiLBWoUxBpMBfmsentD7dXJgVzoMff2E68AizQ I/KFoDOouZsZtTpr8/nvJFzeFZBI6H8NnsAd+pGzSsyr3cXcWev+wIT4hds1cv1q3ABL+Ciq5nYdf 9gT0IW07TrAOBV84oz5zW8BpcV0FF3tcLX1mZd9xsQC/EVotxfxtCykuMoq6xlf/UY2g6DFZTti84 KHiqyKLmaXZ5ly5csYpGVg/cMELi1qCsE0/Ka8JhCrka9ijcxlBS/S0oXeNHFtzZdbksO9LIulyHQ lBR1edkA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5w4M-00Emdp-Ee; Thu, 15 Dec 2022 21:47:10 +0000 Date: Thu, 15 Dec 2022 21:47:10 +0000 From: Matthew Wilcox To: Nico Pache Cc: Sidhartha Kumar , linux-kernel@vger.kernel.org, linux-mm@kvack.org, muchun.song@linux.dev, mike.kravetz@oracle.com, akpm@linux-foundation.org, gerald.schaefer@linux.ibm.com, Waiman Long Subject: Re: [RFC V2] mm: add the zero case to page[1].compound_nr in set_compound_order Message-ID: References: <20221213234505.173468-1-npache@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 15, 2022 at 02:38:28PM -0700, Nico Pache wrote: > To expand a little more on the analysis: > I computed the latency/throughput between <+24> and <+27> using > intel's manual (APPENDIX D): > > The bitmath solutions shows a total latency of 2.5 with a Throughput of 0.5. > The branch solution show a total latency of 4 and throughput of 1.5. > > Given this is not a tight loop, and the next instruction is requiring > the data computed, better (lower) latency is the more ideal situation. > > Just wanted to add that little piece :) I appreciate how hard you're working on this, but it really is straining at gnats ;-) For a modern cpu, the most important thing is cache misses and avoiding dirtying cachelines. Cycle counting isn't that important when an L3 cache miss takes 2000 (or more) cycles.