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 57C90C433EF for ; Sat, 21 May 2022 20:13:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A1EFA6B0072; Sat, 21 May 2022 16:12:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9CE226B0073; Sat, 21 May 2022 16:12:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E4DB6B0074; Sat, 21 May 2022 16:12:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7FE3C6B0072 for ; Sat, 21 May 2022 16:12:59 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4C7A2203CC for ; Sat, 21 May 2022 20:12:59 +0000 (UTC) X-FDA: 79490848878.15.7E6CE1D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id B3379140017 for ; Sat, 21 May 2022 20:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tdfpypjILo7uMMEjNSBlBhMSijPAPOm5pT3lespMGJ8=; b=QZd8y+vsLi7Ifyi4NS1iHvzuD9 fqH435LIS8G+nYad9wee14NEXvzpfjYmj0GT4VGhV+LUqXWhJU6XRWRbp9pkH/e04ZeqYnHrZKMMs V81a/HXSnFA5pjWC9Z+JKzgQp+PQsSjOjRXDIARyqg2PxyQe37gswu0DrMIIOS1PhRYHDYGg64Yp8 ISOPMqK4TQ3cpH6NX3fUUZQQ1ym32QBiB97oHPBIxdqJHj3tgP/iMICNBURMjAw3sWI0ZgN7hNlyP jMNAsOK9mobt/BzFGioV6vlMK8bQy9A1HRg4lViiOOyQvj1gnEG7ZOp0JfJdqpIctgdGLjzb7YcGF dFGaDyFQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nsVSh-00Esiq-EY; Sat, 21 May 2022 20:12:31 +0000 Date: Sat, 21 May 2022 21:12:31 +0100 From: Matthew Wilcox To: David Hildenbrand Cc: Chih-En Lin , Andrew Morton , linux-mm@kvack.org, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Christian Brauner , Vlastimil Babka , William Kucharski , John Hubbard , Yunsheng Lin , Arnd Bergmann , Suren Baghdasaryan , Colin Cross , Feng Tang , "Eric W. Biederman" , Mike Rapoport , Geert Uytterhoeven , Anshuman Khandual , "Aneesh Kumar K.V" , Daniel Axtens , Jonathan Marek , Christophe Leroy , Pasha Tatashin , Peter Xu , Andrea Arcangeli , Thomas Gleixner , Andy Lutomirski , Sebastian Andrzej Siewior , Fenghua Yu , linux-kernel@vger.kernel.org, Kaiyang Zhao , Huichun Feng , Jim Huang Subject: Re: [RFC PATCH 0/6] Introduce Copy-On-Write to Page Table Message-ID: References: <20220519183127.3909598-1-shiyn.lin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: B3379140017 X-Stat-Signature: n9utchtr7qf3iu1j833br61jxcncamj8 X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QZd8y+vs; dmarc=none; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-HE-Tag: 1653163974-554843 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 Sat, May 21, 2022 at 06:07:27PM +0200, David Hildenbrand wrote: > I'm missing the most important point: why do we care and why should we > care to make our COW/fork implementation even more complicated? > > Yes, we might save some page tables and we might reduce the fork() time, > however, which specific workload really benefits from this and why do we > really care about that workload? Without even hearing about an example > user in this cover letter (unless I missed it), I naturally wonder about > relevance in practice. As I get older (and crankier), I get less convinced that fork() is really the right solution for implementing system(). I feel that a better model is to create a process with zero threads, but have an fd to it. Then manipulate the child process through its fd (eg mmap ld.so, open new fds in that process's fdtable, etc). Closing the fd launches a new thread in the process (ensuring nobody has an fd to a running process, particularly one which is setuid).