Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754498AbcJ2Vye (ORCPT ); Sat, 29 Oct 2016 17:54:34 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:49419 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752380AbcJ2Vyc (ORCPT ); Sat, 29 Oct 2016 17:54:32 -0400 From: Arnd Bergmann To: Yury Norov Cc: James Hogan , linux-arch@vger.kernel.org, Vineet Gupta , Catalin Marinas , Will Deacon , Mark Salter , Aurelien Jacquiot , Yoshinori Sato , Richard Kuo , Ley Foon Tan , Jonas Bonn , Chen Liqin , Lennox Wu , Chris Metcalf , Guan Xuetao , Andrew Pinski , linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, uclinux-h8-devel@lists.sourceforge.jp, linux-hexagon@vger.kernel.org, linux-metag@vger.kernel.org, nios2-dev@lists.rocketboards.org Subject: Re: [PATCH] asm-generic: Drop getrlimit and setrlimit syscalls from default list Date: Sat, 29 Oct 2016 23:52:56 +0200 Message-ID: <5026984.UigzJE9bBY@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20161029214541.GA20037@yury-N73SV> References: <1477138444-14993-1-git-send-email-ynorov@caviumnetworks.com> <2502005.4risrb1P1I@wuerfel> <20161029214541.GA20037@yury-N73SV> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:rwVMgLJG8PEY6K5/uAod4WWQf3i80OHarnQwRTOw8g5ynR/EyaF 8z+wxEWceiRlw5MkzWgazLD8fHXHnaIMhb+/LCniKVWsvOFbgz4ylex9WJP202n98q2eMPc lyvRLUb7EZV20+3n03Pku7IjN/s4iuJyPawRQuJnmzJDs1NDyLTtJ8QZN+Sehg/sKrDgp8e jL4hWQ9/EkZNA2eMxLyHg== X-UI-Out-Filterresults: notjunk:1;V01:K0:HqTSIylYsz0=:hXGOTt5G+LPLDxx/JkljbF lavu690e6ZO5r4+KlHCtqwh9jj/RdpZJVfWl980CWeW0QpIzu47CIhVUrG+lRvb585kkqMqgb ekuray3W7IaViZ48F5dxSYJJ53IbZWcJYEBahHepCmeCUgJQXUPgDIfADMhJA9POYcSkgtTbX t2FacOAYoGkmEuqbU+asN+qy6+HwzCyP+KJrwzhAZ91e4cgS+iSB14SWLCd0r74sZjGiyHeqi oUljEZAjJ3LotlwVD5ZJvVh7ZNv8p8gNDAKayypw2VEjNr8eLP+/CFs9JFqNBs/uhEGzVAkvv qiKIucYoP5hqaQs4bKMhvoOC2/R6JxBirD+VuYa1K6V+JoE1/6gvhSln86/dt2ezdpt8gpj3M QN7sJpztuVK5MXXmDHIeM+6z5Xyyj2rWPQjA5sRNoD3XkJaB/AVkyHqA730IcCV/8zRP2wiv8 0jpRlyzeTebY0m3fN3OUa4YeFEcRFl8EImpDWekFvpIcHOtJpQN7qVxmVkzyiznpaOg96Efft TsaJFMFNhaL7FRxGghV8JzPq99U6BNKyQMnK1bz0cEeERHu5cwhJs4U5apxRWh2mvyGU8CPeX wqHTAzvr35OegwFF70eub9SarrnKs87BFBargK66pV5MP3PnWOeGtb7Afs27k9Q0mmAUCU3zw P4El0cCSm0SgGltjPNG+iuv9ZfgZyM6wQ2K6+G62UgdGQ0FnbBPgKRCXGzgw0ABcV6Nt/Fe52 AJYsT20+An1wrBcP Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2166 Lines: 43 On Sunday, October 30, 2016 12:45:41 AM CEST Yury Norov wrote: > On Sat, Oct 29, 2016 at 11:02:40PM +0200, Arnd Bergmann wrote: > > On Saturday, October 22, 2016 3:14:04 PM CEST Yury Norov wrote: > > > The newer prlimit64 syscall provides all the functionality provided by > > > the getrlimit and setrlimit syscalls and adds the pid of target process, > > > so future architectures won't need to include getrlimit and setrlimit. > > > > > > Therefore drop getrlimit and setrlimit syscalls from the generic syscall > > > list unless __ARCH_WANT_SET_GET_RLIMIT is defined by the architecture's > > > unistd.h prior to including asm-generic/unistd.h, and adjust all > > > architectures using the generic syscall list to define it so that no > > > in-tree architectures are affected. > > > > The patch looks good, but shouldn't we also hide the actual syscall > > implementation if the symbol is not set? It's just dead code otherwise > > for new architectures. > > I was thinking on it. The patch of James Hogan, b0da6d4415 (asm-generic: > Drop renameat syscall from default list) doesn't do it for renameat(), so > I decided not to do it too. It's not so easy to disable syscalls because arch > may support few ABIs, and some of them may require the syscall. For example, > arm64 supports lp64, aarch32 and ilp32, and first two ABIs need renameat() > and getrlimit/setrlimit. > > At now there's no arches that doesn't need renameat() and getrlimit/setrlimit, > and there will be no such arch in nearest future. So there will be no > dead code. > > But I agree with you that we need make that implementations > conditional. If I understand it correctly, we need something like > __ARCH_WANT_SET_GET_RLIMIT in all existing Kconfigs, correct? > > I think this patch may be applied as is, and if needed I can send > another patch that disables renameat() and getrlimit/setrlimit soon. Fair enough. Actually now that I think about it, there are probably lots of other syscalls that are unused on modern architectures. It would be good to go through the full list and hide all the ones that are not referenced, but that is clearly independent of your patch. Arnd