Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5331689ybi; Wed, 12 Jun 2019 00:22:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+ncy7qM2LhTY4nh6siyxbvwhEX2SnmJx96m+qQIEJ+MwNpbX8ZfzhKu+oVWkOhHCKAmI8 X-Received: by 2002:a17:902:8649:: with SMTP id y9mr3606664plt.289.1560324133507; Wed, 12 Jun 2019 00:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560324133; cv=none; d=google.com; s=arc-20160816; b=GUChRNTDg6U24qSWRW+w99ibkTedxq/3Gg3Hk3dj8udMudHNlvNfuO2nVeUH4aSYu9 UJylm1+vLBodLA9I9Ta7PYu5D3B71Xyq/5Ga8+0WFzC+XZtjxxSk8vdNPDS3sxDjtp2/ AQSneRkE8WTSfhguJXpduYb0DKRV9kJN271Qg4T27c6IGrMOzZ8oYgp4+ZtUYfLAm0ZH 9Prj/pmL0HDd0AgSdCnInumgAG0XRz6vqc9l7xd1i8Aoe+yOqHNjkgHratKc9sRRAAAQ CCkeSHSa/wV9/VrCnjO8gHUK6gJNdPTsq1S2UWeMxMNXl8fTuZRKnuWmbJDnxkeWEows 40zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=CtAUnKccNVM3Ar1NimuBm5cYjQQHpUUV35G3NGl7I18=; b=q/w1LzHcOIRjrd1j15dWQABXXZUUD3tnwBrQklkkHP5uPOrIlY/YRZAGBdMD8b62im NXC6q4Fe6B4cKmeyUtm/ucoHl2TVnGuZOqNZ3CGTvryB1odhfP7SmfttJaK6ERfXdTqr sMQ3svmfTLQ96j/Mx7ASD8wCZbYi9VRWnaRp4LgFbHOtL7BgDuizt3ykgbjizXCxuGXs TOoNYwUf3W2SLWiQaMP73f0KY0tL7fToo/f+c+RgEJF2nDsOruEq4LmOW52/04kXAzSQ Ko162m4pfv/eQg9wLgNpsiZ8jzj9IdckoCZeKwIZ2nm5JcwvbV7hn84qAZ6zNgDKMM+o 16sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=agp8Ljxg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si522310pfn.182.2019.06.12.00.21.57; Wed, 12 Jun 2019 00:22:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=agp8Ljxg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406674AbfFLB1N (ORCPT + 99 others); Tue, 11 Jun 2019 21:27:13 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41418 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406215AbfFLB1M (ORCPT ); Tue, 11 Jun 2019 21:27:12 -0400 Received: by mail-pf1-f196.google.com with SMTP id m30so8052610pff.8; Tue, 11 Jun 2019 18:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=CtAUnKccNVM3Ar1NimuBm5cYjQQHpUUV35G3NGl7I18=; b=agp8LjxgsiKUNBRzMQ6B1lsikXTP9MXAxScOYcZnsKclD0N+jlNVoUl/hzW4poyT5e 3L5Kpn7BSqpfe4Vqr0OMLbW+npbpmydrSh4Nk6mj5SGyx5Jj6jf653H8VmcdoFa5nFlP PVXiNmiBrwZEiKboElbWiL4LdjFKAAbWcoG28ZIwtcy8dPhR9hlh49PJ6xikrmMZLHzP 20qVkn6ttaCMzY1I08lsTIN5eoleBIFYn7aRuLf/OzGJBwoDwiiv7JFIo5WL8ooodEKt b/SI9mnoX3vTwRgRrKm2an9+aTc8TPah2tNonQDJrq5z+DrzQV1yJmuEkhrXeIPbcuOQ mhuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=CtAUnKccNVM3Ar1NimuBm5cYjQQHpUUV35G3NGl7I18=; b=FzhAsGYxmBnN668L0avinUo4XrpGKzI143/f++HbbliQdoUWYL7rIB07JskNWd+DU7 9+jmbLvpyufPPU8eq2izcCQRPo6orwcxUzTS5OUq7UHKXLLbMSF/8DIg84j79oFaTWzH E/Wf2FNiDzxa7xnKm9OoWDmikQTdDGdNnhVVBS6MJm6hrgiPmAba2fijUfhXxYpekJD5 un5jWa/UL28tWsTkCFge14d0BYjkEI442PL0hQcNImY80LK60XtCruQlHxXE12hXaNrD TVcToHfg5GzGvJ2hFzaL1CPH0OrbIsZZwU7xYr0epJ4Xmv6eUpK9T9Zd/dtqzCSv62oS Ovpw== X-Gm-Message-State: APjAAAW63NOZnX17illK661RcsXbWTv8zbb9LMRh6E+aeNPIC6DjZn8x UlVnDtutcFL11xnw3IiiJkk= X-Received: by 2002:a17:90a:cb87:: with SMTP id a7mr10403544pju.130.1560302831475; Tue, 11 Jun 2019 18:27:11 -0700 (PDT) Received: from [10.2.189.129] ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id c10sm3547108pjq.14.2019.06.11.18.27.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 18:27:10 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure From: Nadav Amit In-Reply-To: <1560300464.nijubslu3h.astroid@bobo.none> Date: Tue, 11 Jun 2019 18:27:09 -0700 Cc: Rich Felker , "David S. Miller" , James Hogan , Paul Burton , Linus Torvalds , Yoshinori Sato , Andrey Konovalov , Benjamin Herrenschmidt , Khalid Aziz , LKML , linux-mips@vger.kernel.org, Linux-MM , linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, Michael Ellerman , Paul Mackerras , sparclinux@vger.kernel.org, the arch/x86 maintainers Content-Transfer-Encoding: 7bit Message-Id: <0441EC80-B09F-4722-B186-E42EB6A83386@gmail.com> References: <20190611144102.8848-1-hch@lst.de> <20190611144102.8848-17-hch@lst.de> <1560300464.nijubslu3h.astroid@bobo.none> To: Nicholas Piggin , Christoph Hellwig X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jun 11, 2019, at 5:52 PM, Nicholas Piggin wrote: > > Christoph Hellwig's on June 12, 2019 12:41 am: >> Instead of passing a set of always repeated arguments down the >> get_user_pages_fast iterators, create a struct gup_args to hold them and >> pass that by reference. This leads to an over 100 byte .text size >> reduction for x86-64. > > What does this do for performance? I've found this pattern can be > bad for store aliasing detection. Note that sometimes such an optimization can also have adverse effect due to stack protector code that gcc emits when you use such structs. Matthew Wilcox encountered such a case: https://patchwork.kernel.org/patch/10702741/