Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp554916iob; Wed, 18 May 2022 07:59:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBk/ya2leourP/0RYjJlAWeAY99FbqqWJr7+usGTNDSqEgmUU+QPl68NOF9uUSOLuTpEvB X-Received: by 2002:a65:6b8e:0:b0:39d:6760:1cd5 with SMTP id d14-20020a656b8e000000b0039d67601cd5mr24352721pgw.379.1652885962899; Wed, 18 May 2022 07:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652885962; cv=none; d=google.com; s=arc-20160816; b=y9Z85XJ/AWg5dBM1jLwmr5LrXS733W0vTeGVPQyv+CEeJPQ8MNuAQnzYyLdLt5/P6o JTOon1VIH50Mv/+3y5aXnc9tKFGmCIMjlVq3oBd3Y/n+cQ1QRkTdg/sTuiMWQpGqaLS4 S4cgxr/C+EzNCsfz9fz69Ij/GMMDWrrg0+v6U015h+t29hc8IrmHZNPJ3h40OiEZ5H/5 jK6A4xCIRuBmr60Ob+DBmIQKiaAY0ElOyoWSq8F3fpVIdxkY1pOKNvavMxwy8DIU+XI6 qjCBX2Qeat+9aSL1+Ps8mLqRmC2smBGa2qOb5dyNzuH7IgfHLw3Gz8x3Y5qJqr2EVBxF 5Srw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4Is6VMKTGS6Q+REIPQaUhYHAbJCVB2LMBP9f+Vwnyr0=; b=PB2HJO4VZJfrY/ULyZw9smRE//3AhrcxWmh2Swtt06hSRveqK/cl3DXfvn0E/N72V8 URAnRtjX5pJR4SyjUCL9xvCugsiTzQU3pZQ2IOiOjvyb02Gc/5C9HwX5pfl2uLWjt4rm nP/ibNXdK6MaXrH9W4C5h+B59shQpa1Zr+Kvm28po5pzBic5EF1YO03uKJkrNSctdEFz YIVNk0+9k59AZe7yxYA5vPbwUCT/bufFffbmF0a8gpUn2Gr7vwD3iiB3zN1fE8HjH+3L xrEyZsKiSRBfcLPJ4AHdXmMxgbg8dZk+cSKzHeUmn7lVK8rUoR6TNfU+XTmCpAlaacP9 utlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZicRzH8+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t10-20020a170902e84a00b0015ed50a1033si3410869plg.406.2022.05.18.07.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 07:59:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZicRzH8+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E7F4319C75C; Wed, 18 May 2022 07:57:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238955AbiERO4a (ORCPT + 99 others); Wed, 18 May 2022 10:56:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239045AbiERO41 (ORCPT ); Wed, 18 May 2022 10:56:27 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4E3016F913; Wed, 18 May 2022 07:56:21 -0700 (PDT) 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=4Is6VMKTGS6Q+REIPQaUhYHAbJCVB2LMBP9f+Vwnyr0=; b=ZicRzH8+hsKxFUFZUGV7uh6rsr liYqq1jo/NJPjFOq45aL15fhGeuMBVY2fPnZKIydDip+x+51BJs5NLmaGT8oWGbYZbNY+K0Pyrkef 6rtOzeBsy0dtcUJ9XhADYUN1Y2oy9oXlw62lJz3I3InUErp1+tH7/lFyOSmAivKaDcxFU8jfS3PYX 5/inIxpdAkkRzXjoVhil+5k58vn049Ny8S6eWbnS3PYIDvtdMiaokBA2YBm3sYTd/JNaiZ0Wbl7n9 ZDo+9nTYLRaDzeaIcwzrVzxX+7iFsugHlQtmCGx0J+QdfouNf4S/mZbzCdefd3KPIBkiWnP0vWdHc TOCI2+AQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrL61-00Bsxi-6p; Wed, 18 May 2022 14:56:17 +0000 Date: Wed, 18 May 2022 15:56:17 +0100 From: Matthew Wilcox To: David Hildenbrand Cc: Qi Zheng , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, songmuchun@bytedance.com, zhouchengming@bytedance.com, akpm@linux-foundation.org, tglx@linutronix.de, kirill.shutemov@linux.intel.com, jgg@nvidia.com, tj@kernel.org, dennis@kernel.org, ming.lei@redhat.com Subject: Re: [RFC PATCH 00/18] Try to free user PTE page table pages Message-ID: References: <20220429133552.33768-1-zhengqi.arch@bytedance.com> <8c51d9ae-5a8e-74a9-ddc2-70b5fcd38427@bytedance.com> <37055be1-05af-f7ef-c33e-27f90fa0f9ca@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37055be1-05af-f7ef-c33e-27f90fa0f9ca@redhat.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 18, 2022 at 04:51:06PM +0200, David Hildenbrand wrote: > yes, I talked about the involved challenges, especially, how malicious > user space can trigger allocation of almost elusively page tables and > essentially consume a lot of unmovable+unswappable memory and even store > secrets in the page table structure. There are a lot of ways for userspace to consume a large amount of kernel memory. For example, one can open a file and set file locks on alternate bytes. We generally handle this by accounting the memory to the process and let the OOM killer, rlimits, memcg or other mechanism take care of it. Just because page tables are (generally) reclaimable doesn't mean we need to treat them specially.