Received: by 10.213.65.68 with SMTP id h4csp193770imn; Thu, 15 Mar 2018 13:55:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELvIH8y7A6R5dQcdwi1MWDZEDcSYmtLS+XWIiaR8hPETi3wHKcLlk9bsxbnd5nehbSEtocjt X-Received: by 2002:a17:902:32a2:: with SMTP id z31-v6mr9334964plb.32.1521147336627; Thu, 15 Mar 2018 13:55:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521147336; cv=none; d=google.com; s=arc-20160816; b=R9VQksQGeTjfX2s6ZESlSseg60EFkAP8hUCNMh6fvo/5PeH8quHdfSLKRcs0lfLhTv i2O1vXFt49zmS2Z+p4963kBgsMmM3aPuRejo9KgPvz29iLvZPEAyXiZFrO368LAMUVOu DmqVBLfxiizZQaOhNRu7rRMlYaDHxGhgbpMTAJCRVMamC0z9UsyHG72V0igI9ctwhAfD CCHUAwKuJGa7bUqo+6/Xl1dvBh97AnUQf1LukYIfxmx9koBufyU7PiASJ07UlIdY0ASt leDbpmJsDunBi5hmPU2CdRKLxUOfHN7daDtNR0Uz2nM62rKA98Z22zSiKxifiRxaF5kv wndQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=PB9Y+N7aqntdyqW6aYri+2yxfAzU3leHqr4R3lQAeZ4=; b=qCfxoJAjWqJmboKL0ZBt2udsDmiqSyi9ulS7LcsRAlf0eNVVxrMaZcQ3Fj3736iiMh V6YCI/4b2hv1MRKFw4jQkXCSbrEPw+ELZDPT6oL5SVmNAsa/Xab7TelFg1DnmXkFgOLw NwfgCLw3oQToFKTmloDsAsPlSAWyjxKzW2syjSpKknvpQDzI1DETKN/6fJatbpjgND3L jk/e104ObLQeJOYMwytZ1yOTVo0Itpj0CMwXLlyoNG+YyYnBQcX6jJpnxCJwR2B2ES24 DUxD699IRxf72AKWlpSo+ryOaL8rmdWIYFxExxUcsgooPGoWbzJ8w4aDdlT313sn2Oc/ N/jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=a0bb4KYd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si3933151pgq.109.2018.03.15.13.55.16; Thu, 15 Mar 2018 13:55:36 -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=fail header.i=@gmail.com header.s=20161025 header.b=a0bb4KYd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752848AbeCOUyW (ORCPT + 99 others); Thu, 15 Mar 2018 16:54:22 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:46026 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751679AbeCOUyU (ORCPT ); Thu, 15 Mar 2018 16:54:20 -0400 Received: by mail-qk0-f194.google.com with SMTP id s9so8847424qke.12 for ; Thu, 15 Mar 2018 13:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PB9Y+N7aqntdyqW6aYri+2yxfAzU3leHqr4R3lQAeZ4=; b=a0bb4KYdsOjEfW7lHEDnsimzMmaEdOU/2/Xv0KYxxJX3na8Je7kqRm5rANzUNxdKPp uOYsIw4BkU2ZJ1MsVKU3iBFJHRZGdk5H8nuk/l3XJViRgUaK2z/6vo7wtXqo+yDREZz7 HDMq+nH9k/Ak+J6/Qe1IlLKMB4yLdOm6L4P3ujQOFaROTolfsrTTB0bqy2/+t7rZ4JVe WmaIUM+qa34O28tYjh8UjCcPx2/GxzQLk76SIyTCrSJb1o9yFAowbaNGFs4Hp5DwMV+S 3kQeawbkFZb4q3NLk3mUArubX9029ldMa9dUoyPhPayzEhyLaeWzrvPjjE3wA2AALoCX TQOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PB9Y+N7aqntdyqW6aYri+2yxfAzU3leHqr4R3lQAeZ4=; b=fH1nQfjN4gh3Lzl695qYhDQ2LAn2C0n6JVr8y3oKZ26R+QOGKcONDtbKg4A5gtWOhz ycSPQCb7Mq5YCdQTddX0EuUMWygH6BjiRh2Q7VceF1qRUPTax2rUI/d2jqBGhf/RpsYm TrTaAmLEh2uhLNym6FDKvv5pyRNkoE2+ptxlhNFYynMeVPfR7ZUaET8bTfGHG9bEcXh5 KEuOa0uSw2owH7EQsJPxAr3frkRnGTD1t1hpSJvD9af0Z7YesfHzbSYI9eSH/A5yNA7U Esz/3LvJJAw3lOLSB+0DsSrTbfl1bdVOMUU1lpeORLBKsCMV8Db+7ijXop9Hhc94ZC63 V9ew== X-Gm-Message-State: AElRT7EAdOopbkYs4Tdfx5WjdYhnZAQFzrUMwBCPk7Av0+2F1xtfxtpi H0jdbmrLU3wRR3zWxqQY//L3zGfgOP8LQTzFV9c= X-Received: by 10.55.195.148 with SMTP id r20mr14754536qkl.173.1521147259866; Thu, 15 Mar 2018 13:54:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.46 with HTTP; Thu, 15 Mar 2018 13:54:19 -0700 (PDT) In-Reply-To: <20180315190529.20943-22-linux@dominikbrodowski.net> References: <20180315190529.20943-1-linux@dominikbrodowski.net> <20180315190529.20943-22-linux@dominikbrodowski.net> From: Arnd Bergmann Date: Thu, 15 Mar 2018 21:54:19 +0100 X-Google-Sender-Auth: XuQOzAkQPI2JHSY_x5vIcVfoark Message-ID: Subject: Re: [PATCH v2 21/36] mm: add ksys_mmap_pgoff() helper; remove in-kernel calls to sys_mmap_pgoff() To: Dominik Brodowski Cc: Linux Kernel Mailing List , Linus Torvalds , Al Viro , Andy Lutomirski , Ingo Molnar , Andrew Morton , Linux-MM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 15, 2018 at 8:05 PM, Dominik Brodowski wrote: > Using this helper allows us to avoid the in-kernel calls to the > sys_mmap_pgoff() syscall. > > Cc: Andrew Morton > Cc: linux-mm@kvack.org > Signed-off-by: Dominik Brodowski It might be a good idea to clean up the sys_mmap2()/sys_mmap_pgoff() distinction as well: From what I understand (I'm sure Al will correct me if this is wrong), all 32-bit architectures have a sys_mmap2() syscall that has a fixed bit shift value, possibly always 12. sys_mmap_pgoff() is defined to have a shift of PAGE_SHIFT, which may or may not depend on the kernel configuration. If we replace the +SYSCALL_DEFINE6(mmap_pgoff, unsigned long, addr, unsigned long, len, + unsigned long, prot, unsigned long, flags, + unsigned long, fd, unsigned long, pgoff) +{ + return ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); +} with a corresponding sys_mmap2() definition, it seems we can simplify a number of architectures that today need to define sys_mmap2() as a wrapper around sys_mmap_pgoff(). Arnd