Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1752559pxb; Thu, 16 Sep 2021 14:53:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEQAuVdVZ/Qd8w7jEXau99p5RHtUunV0f07nEIxpY5+yH46EsKofE4bf8maWOpb+8OMivt X-Received: by 2002:a05:6e02:1a0d:: with SMTP id s13mr5303788ild.240.1631829204202; Thu, 16 Sep 2021 14:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631829204; cv=none; d=google.com; s=arc-20160816; b=kpLxH7aBBZNxAighU+cEu5iyF49Fx0JbhghUtmGlmRbEY88v2pJzX21kUFhxUE4lUT 352RxAVyoK+38podL2Z0j2sur7hFIJOIYrhbyrySkhHBnjuzaLgLGLkN6zsVe+TEOep0 kqhyHtfxyecFN6Iy0CWMkoATAZkNYM2UrTEgD3JtBL5UT881x0sDIOYpiPfQkV91lYQg PpMLtBFQJmJbspKbzMAdi6d/k277wbkMMLHQId/UcIU/xrrwbaw1dfRC7gf8KuR42oUW HRMB4IQrY9W3SAZgArD6cX8frPc0KetjDDnfL2ccjS4r+EDSOQWU1O+HpfkmxKRMpD77 yrsg== 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=MKo7QL6EM1sawmc/BnRon9mSosLiCwe+CA/1jDvWgt0=; b=ttwhuXfGALaNT7BJMLfaZfMIWZd6Dr9FjIWHPyvrMqeJCgtQ9+mklFqqC9Uu0UnNXT 9B2Vc1exVdUTg+Z22JGe2SgrWPQiTOc3cmE0HTnSZmmbX74znABSnB4r674DNvUv6ZYJ QpAeka72GdHJjVCZ3fLvJrGnk3Q1GI9c0EF118gwVmEMvVrAJFT+Vy9aOSiUrXLh68aS 3ciXRN/ip6snLjd0zVf11lGlHEfrRhU9XIwHfQ6H9XwNqYGM56ApCIheOCvdC49vNkAP wgvhyaE7oBISNJXxQ26/Dt8B1m19NOE1YhevgTX6DxETNxIEUNsV06dbW+FFlYlL2gHc SrCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BM7e5RlM; 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 o38si3808331jac.39.2021.09.16.14.53.12; Thu, 16 Sep 2021 14:53:24 -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=BM7e5RlM; 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 S244193AbhIPQig (ORCPT + 99 others); Thu, 16 Sep 2021 12:38:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:44326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241474AbhIPQbJ (ORCPT ); Thu, 16 Sep 2021 12:31:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E31E66137D; Thu, 16 Sep 2021 16:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809154; bh=fYi5Vj0hvNhaeRT8uo3OjxcwrFslV1ekSpdFtnZZzBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BM7e5RlM3MJB3GDrUbdBaLHhsfOm+Z7/tJCpgqLD+Wf3dEL7M43ccHgbDBTBmnosw UEqwRHEYaO+9CjkW4I7YsP17xiSiCPBWvRNsxotTD8RqK6YjtaA0A0M5CbPlYlcYoG fYaBMMbpeNxZ9LKKlJlHIn15n57c631zndbWxV1I= 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.13 051/380] io_uring: place fixed tables under memcg limits Date: Thu, 16 Sep 2021 17:56:48 +0200 Message-Id: <20210916155805.717753236@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -7195,11 +7195,11 @@ static struct io_rsrc_data *io_rsrc_data { struct io_rsrc_data *data; - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = kzalloc(sizeof(*data), GFP_KERNEL_ACCOUNT); if (!data) return NULL; - data->tags = kvcalloc(nr, sizeof(*data->tags), GFP_KERNEL); + data->tags = kvcalloc(nr, sizeof(*data->tags), GFP_KERNEL_ACCOUNT); if (!data->tags) { kfree(data); return NULL; @@ -7477,7 +7477,7 @@ static bool io_alloc_file_tables(struct { unsigned i, nr_tables = DIV_ROUND_UP(nr_files, IORING_MAX_FILES_TABLE); - table->files = kcalloc(nr_tables, sizeof(*table->files), GFP_KERNEL); + table->files = kcalloc(nr_tables, sizeof(*table->files), GFP_KERNEL_ACCOUNT); if (!table->files) return false; @@ -7485,7 +7485,7 @@ static bool io_alloc_file_tables(struct unsigned int this_files = min(nr_files, IORING_MAX_FILES_TABLE); table->files[i] = kcalloc(this_files, sizeof(*table->files[i]), - GFP_KERNEL); + GFP_KERNEL_ACCOUNT); if (!table->files[i]) break; nr_files -= this_files;