Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1913872pxb; Thu, 16 Sep 2021 20:05:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIKJCMnqWdQTStp1SlrU3LAB+fgECwb6OeQzXh2hRCh1ytnLY5dGla7bh4p+Yj5xhLi0Ph X-Received: by 2002:a17:906:25d4:: with SMTP id n20mr9669258ejb.399.1631847941282; Thu, 16 Sep 2021 20:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631847941; cv=none; d=google.com; s=arc-20160816; b=HPhsxXuhYcGta+3eHpmSeH8V+f0HWlN1wYf4Croa1UqCh9H+a3VyShkXQqgg0Kw630 5y7NMNLeftH1bsOAVu++P3CvC/Lo4Q42LifzAKQNbEPZV64U478FwNZOAXkMA981TGXw x/1lEbVpDYPnE8Wa/vBAxUOsLFxd/W435ai4LjWKddaXRFgNje4iB0Kv1kGHYtJY6lIb 7V0qOdWK4RbwTCkG2wEA0wTkQghhvWKru//qVCLqMomPEwGWpw4MvQhFPg345FfMOr7/ ZKI3yzwOF2nV8yRDA2G4g07h1lpU12KZxnzqv3lbBEAuYAemLC7NRBQEm28N3IVK3gZ3 PQaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QvetNkDb2ZwBRxwM+PPioyW1ujYbvViN6oElDpoI5Vk=; b=NW0iDCJbChBUy2lzL9e7FpzXmN5XGrL1Qd7pgyKEBoD5dZEEZbTWmgv//GBx9037cs ACITBiUanYaIQGl0KE3z3lfwxw2cIDIJ7f5u3/6QXGJMs8mOyrps8Cj/0U+w8sDypYfQ TQ9YVBOYprYjmueC422M+UikcyK1cD1nn3IyUQ+xNV9L8yt8dlTZG0NtyIxtWiJocCEe xP7S+4AY6Bply6Y5IoPXAZdVwIqV/B6aGW8BawJjODqLeC2UN+ipKpDkVuxnfmKdGSo8 VoBtXhXHLXr9mnxLlvZ7T2XcbKkD43nsmm4vvGf/VRaU/y7U+/gGE+oel0Oo6y6SXDjC gtPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FcchjMTE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si5541250edk.324.2021.09.16.20.05.17; Thu, 16 Sep 2021 20:05:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FcchjMTE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347431AbhIPRWv (ORCPT + 99 others); Thu, 16 Sep 2021 13:22:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:34166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346545AbhIPRFS (ORCPT ); Thu, 16 Sep 2021 13:05:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 08CC161B1C; Thu, 16 Sep 2021 16:35:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810112; bh=Cck+dXftzkLrcA22ZZHAK/uDUVPfUpcQBGQdQ6b1Aho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FcchjMTEsod9Gu1wXjWq7+DQ08tHdIZtIKlm9jfr7YcJXpZw9Bv9qHSaZd75Q4lC3 VjCf0+caqD6V/c/shhdJxrE3lIUxRBXCOLR54iLzkQzIiQIjof5G5RV45s9JaPIO3M JFbS/GyhiP6PGhuXJqQfOSYu3HP5EHdQK7CTFKBU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Begunkov , Jens Axboe Subject: [PATCH 5.14 003/432] io_uring: place fixed tables under memcg limits Date: Thu, 16 Sep 2021 17:55:52 +0200 Message-Id: <20210916155810.938190192@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Begunkov commit 0bea96f59ba40e63c0ae93ad6a02417b95f22f4d upstream. Fixed tables may be large enough, place all of them together with allocated tags under memcg limits. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b3ac9f5da9821bb59837b5fe25e8ef4be982218c.1629451684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- fs/io_uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -7126,14 +7126,14 @@ static void **io_alloc_page_table(size_t size_t init_size = size; void **table; - table = kcalloc(nr_tables, sizeof(*table), GFP_KERNEL); + table = kcalloc(nr_tables, sizeof(*table), GFP_KERNEL_ACCOUNT); if (!table) return NULL; for (i = 0; i < nr_tables; i++) { unsigned int this_size = min_t(size_t, size, PAGE_SIZE); - table[i] = kzalloc(this_size, GFP_KERNEL); + table[i] = kzalloc(this_size, GFP_KERNEL_ACCOUNT); if (!table[i]) { io_free_page_table(table, init_size); return NULL;