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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28D98C4332F for ; Thu, 15 Dec 2022 22:03:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 921428E0003; Thu, 15 Dec 2022 17:03:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D1638E0002; Thu, 15 Dec 2022 17:03:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7992B8E0003; Thu, 15 Dec 2022 17:03:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 6AB038E0002 for ; Thu, 15 Dec 2022 17:03:15 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 31BA916022C for ; Thu, 15 Dec 2022 22:03:15 +0000 (UTC) X-FDA: 80245917150.05.BF2A9B5 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 4B1B2140015 for ; Thu, 15 Dec 2022 22:03:13 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KKjDizZk; spf=pass (imf26.hostedemail.com: domain of npache@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671141793; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BPKipWOXSyP8E5uQq5bsZzZCMqia+WCVTmajdnr3pN0=; b=GXlHV9Oa6U9HtzqdgbdqmYtho7CVDlaxQw651+Efaaek3IPSc7I27z1C0Jk1A4Maiam4jP p1JuhKIqDTWsB+o+/ClTOjrb2eKvIKbDQ/03AnXJRvz1lnvovuGStZ4IEsutTypRebQOXB eczWv22B1xMZ6W/mBtMQR1ok++v0aio= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KKjDizZk; spf=pass (imf26.hostedemail.com: domain of npache@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671141793; a=rsa-sha256; cv=none; b=o0xwWK2mZg7EyEopoaLE5RyOYBhHlNWAsdf7qQ4io6cCu0ZLGoWvHUaT/nUx6ggB6vurN/ /jch0BZfKtmfO6Q2qq5n0lRz+5rBAb0M6MvWpaUv2axCS/RTa4g7q5Ilr2QHzbPv+gEeoz b4r/Bu+M/QWKPBtU2+mvROrPAN09hC8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671141792; 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=BPKipWOXSyP8E5uQq5bsZzZCMqia+WCVTmajdnr3pN0=; b=KKjDizZkxziferoidrU3YCxCN3NXl818TV67lHgQoNw695ry2Uai8WjY4Df0nLwxqCZ1RY Nwea2UIj4B3Xi/MyXYv9yCJoa6Uf2VUusAN0YQR9Hlw41mPTJTf0Kfl6/e609hHs+YXQ9u GbyJsZuQVYPXQstsstmrWALk4dN6/Lo= Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-569-ktNUVa7NNh6wq6V83mdxJA-1; Thu, 15 Dec 2022 17:03:11 -0500 X-MC-Unique: ktNUVa7NNh6wq6V83mdxJA-1 Received: by mail-yb1-f198.google.com with SMTP id n197-20020a25d6ce000000b00702558fba96so469577ybg.0 for ; Thu, 15 Dec 2022 14:03:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BPKipWOXSyP8E5uQq5bsZzZCMqia+WCVTmajdnr3pN0=; b=xeVsfG066mQ39TQRv5KW7FiU+Lju4PDHHWQPMiBDmNHdeiXGgJuwfPsZToIPMoVbrk CnmcADQRBu+as3hy4GzfnLMzUrLUfFAlgwrq5AyZW+AH4SXHQRG3fClu89aWYd2WAJrF QGe5fQZrcTLuo8TQG0nd4VGJkX9v2lpo5JAkXxoPTMVv4zl1WZ0mjCoPERCX1x7GQdIn YpdMeH+DACDwnOk2C90KuERYfa/qHGHEBjbFQCFds125Vq15kWBvA3aIWiWQT3hE3/hC Bf4FhtTvwWFcwKg2iACV9CnSKvwwsqW0WwVjmJhRmrFwOL6GGVwZ9KGfvO98FaRlEaYt ryjg== X-Gm-Message-State: AFqh2kpunUmFGdx63obafgLGyts/qttTize1O3qg0n1HERcUj8Eve7P9 zWUEP1RT3pDPDNuaSkwk438oKnw7lRC48GefUfvFpzaR4xIRYLQQ0vJSh27wzcaZQ9EQXABCxIq 3th4a+m4r7Zsi0dLS8Z24DqOlckc= X-Received: by 2002:a05:690c:b89:b0:3d7:66df:9b62 with SMTP id ck9-20020a05690c0b8900b003d766df9b62mr416828ywb.133.1671141790979; Thu, 15 Dec 2022 14:03:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXvRzSEPBaBgu+lJoSwm3w6Biagapn8KFVa3XKSPikZdwWEZUIarQmDfP54zT4H9lanCQ/5IaDmz8Cwg446vXFA= X-Received: by 2002:a05:690c:b89:b0:3d7:66df:9b62 with SMTP id ck9-20020a05690c0b8900b003d766df9b62mr416819ywb.133.1671141790717; Thu, 15 Dec 2022 14:03:10 -0800 (PST) MIME-Version: 1.0 References: <20221213234505.173468-1-npache@redhat.com> In-Reply-To: From: Nico Pache Date: Thu, 15 Dec 2022 15:02:44 -0700 Message-ID: Subject: Re: [RFC V2] mm: add the zero case to page[1].compound_nr in set_compound_order To: Matthew Wilcox 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 4B1B2140015 X-Stat-Signature: k1z58s6i4j41r61q5i6r1aq48pnyc5jk X-Rspam-User: X-HE-Tag: 1671141793-544825 X-HE-Meta: U2FsdGVkX19Pi4SkwjAdQ+xlrV+1KeTnt96xer3hYf0hELv9qTGd2O+qnp9HzaJcE4GqG5hWecHJUXwAIzpNxe/NreTrZ5jktV7CfYCNSgcIXC5IyLPb0P/6tD0M66cnCqN+lyog5TmOgoF90U6oBHVr84Gf5phABLYffmiJNBZexX67omNtBi6XWG4wtGxlEtgE0R7eRLp5ZeQKDGjSHjfn7xSK9YHUIEdiyowpn47GB9nQN9Xxh8j/AVVUxHCZU1OBph0XgVNtoEoCbujfvwbLcX3VPgqpxFhuyqtde/vufZaMbvY+N/nrSBF4nwEBLBUm1ZoYk3eE0P+D87UzUvt94GRRomTIfFwHDt2IvrMn2Zlff32qLmFWdcf5aDjwK9q/goC0oWOc1rxQvhDxj1DCH56Y96PeshLwsfCo+l5xCd6HW3SEZIqAv6PhmQSyQQ52Nh09WDKwCFxkkzXO+ccfjYTdSvjOJhCgmcXNE7dsE1Lt+iyEuekPjH9aHKlJ4yloUwHlD4WGkv3uqj/nHM+zrgiX8qntRT9SrSutCqNei79CYIC1IGz+mcWU/lq7/goJyUtk4aeKgW4RWcFE/NiXwS6ZjVt/t2L30IrSchG0lxxrV6yFHW8olralENLld/jxLes5ZblSVpHi5kvPwSTz9UKg6WpJO5ZqiwyrICeHGyJQbODtdE2tc/mrav4IOcNj6JcoDPoBnp/GKa20e0gm17p++vZQNETrfbKh3eNvjzKVaYFpwqIowrpkEQkAEIr6oOqu+tN3hH3jYatdHFfdv2AMMsrlt/po1Awto7PlzNTwSLC8l5i+JusXlAJK0c6KXRG1Z/AN42FqHrNKQ82C7t4EcsCMEogDzwvzqNkNaKOd7W2kfzOMRGgO/HbXsuouECQ+0p+OugyASIowvVxkj60u5vK9LSqtGPIPBPMlX/ztq6mJJZGzHVyV1T2e/2LpfJ3qJYMyKDIVE5p vL0Lmh2v UX1c+LwI6zTg0LRiPYhz2dgEoOCpGCfM5vKzIuYb0kn2phNhKLRQqfn/AVMuhBLa36nlU98BiQYn2afw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Dec 15, 2022 at 2:47 PM Matthew Wilcox wrote: > > 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. Haha yeah I figured so once I saw the results, but I figured I'd share. We have HPC systems in the TiB of memory so sometimes gnats matter ;p The 2-3 extra cycles may turn into 2million extra cycles on a 2TiB system full of THPs-- I guess that's not a significant amount of cycles either in the grand scheme of things. Cheers, -- Nico >