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 X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E4BDC4727D for ; Mon, 5 Oct 2020 09:20:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 84F0B2078E for ; Mon, 5 Oct 2020 09:20:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="lUiZk6nv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84F0B2078E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BA1698E0001; Mon, 5 Oct 2020 05:20:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B01E86B0062; Mon, 5 Oct 2020 05:20:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A2378E0001; Mon, 5 Oct 2020 05:20:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 66CA26B005D for ; Mon, 5 Oct 2020 05:20:34 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id F3D6E180AD804 for ; Mon, 5 Oct 2020 09:20:33 +0000 (UTC) X-FDA: 77337326388.12.news59_270b046271bc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id D4F7D18055A04 for ; Mon, 5 Oct 2020 09:20:33 +0000 (UTC) X-HE-Tag: news59_270b046271bc X-Filterd-Recvd-Size: 3033 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Mon, 5 Oct 2020 09:20:33 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1601889632; 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=/jLybspX4sh2YZYLrtuLA0SCyoflJWvMsPlKpVe9VrQ=; b=lUiZk6nvygX1QLMSavN0Ypn4+QRF0067YjB82q7ymFKOSAnzUsfC2KeCF7bm/lVhw4fVZ4 +GCO/9FZeblj3HeIAZHbkKlSyphBlSIh0yVLiMmkrwLlC1aeTFopt1lCJgomSjHZX5C24M Oc5oYnc1sJTm7RcMNPuZZ7LRggp7fCY= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 38B7DB2A3; Mon, 5 Oct 2020 09:20:32 +0000 (UTC) Date: Mon, 5 Oct 2020 11:20:31 +0200 From: Michal Hocko To: David Hildenbrand Cc: Topi Miettinen , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: optionally disable brk() Message-ID: <20201005092031.GS4555@dhcp22.suse.cz> References: <20201002171921.3053-1-toiwoton@gmail.com> <653873ef-2a57-37e0-1ac3-fba763652b35@redhat.com> <2a0f5ade-d770-c36e-50bc-ff0c8e9dacbf@gmail.com> <20201005061248.GN4555@dhcp22.suse.cz> <888e62e0-3979-207b-c516-ddfc6b9f3345@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <888e62e0-3979-207b-c516-ddfc6b9f3345@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Mon 05-10-20 11:13:48, David Hildenbrand wrote: > On 05.10.20 08:12, Michal Hocko wrote: > > On Sat 03-10-20 00:44:09, Topi Miettinen wrote: > >> On 2.10.2020 20.52, David Hildenbrand wrote: > >>> On 02.10.20 19:19, Topi Miettinen wrote: > >>>> The brk() system call allows to change data segment size (heap). This > >>>> is mainly used by glibc for memory allocation, but it can use mmap() > >>>> and that results in more randomized memory mappings since the heap is > >>>> always located at fixed offset to program while mmap()ed memory is > >>>> randomized. > >>> > >>> Want to take more Unix out of Linux? > >>> > >>> Honestly, why care about disabling? User space can happily use mmap() if > >>> it prefers. > >> > >> brk() interface doesn't seem to be used much and glibc is happy to switch to > >> mmap() if brk() fails, so why not allow disabling it optionally? If you > >> don't care to disable, don't do it and this is even the default. > > > > I do not think we want to have config per syscall, do we? > > I do wonder if grouping would be a better option then (finding a proper > level of abstraction ...). I have a vague recollection that project for the kernel tinification was aiming that direction. No idea what is the current state or whether somebody is pursuing it. -- Michal Hocko SUSE Labs