Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp437404ybj; Tue, 5 May 2020 01:13:52 -0700 (PDT) X-Google-Smtp-Source: APiQypKMP/jJHPTU0Lhp4myp+Ly9nVF5E+5mPsw0BMjWHpEEYOMK5D0x6uYlmF9UYFHMGEy2ZFWC X-Received: by 2002:a05:6402:8ca:: with SMTP id d10mr1540251edz.167.1588666431889; Tue, 05 May 2020 01:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588666431; cv=none; d=google.com; s=arc-20160816; b=wh1m7cZuI/3Tn07NaSnsxeSCnxFHLIZSBE96bVlTF3gb4d1tXaFOPdXoePQ58ZkgLD +PRdj45mpgCzsaI5HZGbJfRckJLDMm3NtSwtv1Hv3sIy/G/QBBB6WEzhb3qnEj880SbF sdZUHywwsl1DpMu3wp8Pb0CSxbCZK2Tdp9aeQBnYXcrNZGGbjinZMwbarqc8BlXF5mh+ YIONihWZthuZlJ7TZWhYFujAEQRPVc+a7nPu4Awk1ezmMs+GzuzURmDmnY3iRglw/p1C utms7h8rKA6czXCUMGuNntoRnzQDUDwBobEOjDLpjblRe/q08TI/FfuJ9C7U7yI3KGAs BcJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:dkim-signature; bh=l/C3b9DCnuqlbf12vX7TbBNdmk3bR5sHrCa2DPOGmdI=; b=Uk0PTTRQxw/M3+WtapZndA6ZWpgLmRq9YdILQBZh+yKGX0qGwAmR2f1rZW7xJF//7G KQ8VLte1yydjtivK19E8Url0Njg6D7YtrXdrHZL/DHuLayx6ozFXAtN/uMF4KrIWB096 RHYXraKXWafVXZtpJnHejWaMuxF0gOkZowd9qiJZ5Zxm22ABlOrawI1IzYuIumFA+UnB qCVXgFgtPtc8DBIcVOWVcwZ2CDtEFo5mHPQVuGlnqv7grHqESe/dlWw7zKLdx+T+D6B6 2XI1Q6+U9dlD3MlH+6gtIfOUuYEEwGkAqQpqyrNL5fYu8HeTdEXsPWHYPet3IUsJIoAy trhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ABosggn8; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b24si860472edr.338.2020.05.05.01.13.29; Tue, 05 May 2020 01:13:51 -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=@amazon.com header.s=amazon201209 header.b=ABosggn8; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728552AbgEEILe (ORCPT + 99 others); Tue, 5 May 2020 04:11:34 -0400 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:1847 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726568AbgEEIL3 (ORCPT ); Tue, 5 May 2020 04:11:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1588666290; x=1620202290; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=l/C3b9DCnuqlbf12vX7TbBNdmk3bR5sHrCa2DPOGmdI=; b=ABosggn8sdi88sjhuPpyMo8Pn/k2chAOxUv1zxknW/0azjfNlXqc78Mu vEiSDC16QdM4iWrdGg3WxM5wiaChoW5ZDhVU+Ofm5SvST+ShMXtMF0DMz z8mAmhqSm2hwrH6BsaJzkXCrSdhQt8U5JH79JAzWeSNaDn8gADWyBrB1x o=; IronPort-SDR: Q0fnFkKi3rRl3HOVQyIb+jpegaGV3s/ezIwGaBW9LEjXF7XnBEthihR+MnjZSVL7Kb328TM0I2 Yt+ssf1Zu6bQ== X-IronPort-AV: E=Sophos;i="5.73,354,1583193600"; d="scan'208";a="30084469" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 05 May 2020 08:11:29 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com (Postfix) with ESMTPS id 5C2E6A1EE8; Tue, 5 May 2020 08:11:28 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 5 May 2020 08:11:27 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.160.92) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 5 May 2020 08:11:23 +0000 From: SeongJae Park To: CC: , , , , , , , SeongJae Park Subject: [PATCH net v2 2/2] Revert "sockfs: switch to ->free_inode()" Date: Tue, 5 May 2020 10:10:35 +0200 Message-ID: <20200505081035.7436-3-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200505081035.7436-1-sjpark@amazon.com> References: <20200505081035.7436-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.160.92] X-ClientProxiedBy: EX13P01UWA003.ant.amazon.com (10.43.160.197) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park This reverts commit 6d7855c54e1e269275d7c504f8f62a0b7a5b3f18. The commit 6d7855c54e1e ("sockfs: switch to ->free_inode()") made the deallocation of 'socket_alloc' to be done asynchronously using RCU, as same to 'sock.wq'. The change made 'socket_alloc' live longer than before. As a result, user programs intensively repeating allocations and deallocations of sockets could cause memory pressure on recent kernels. To avoid the problem, this commit reverts the change. Fixes: 6d7855c54e1e ("sockfs: switch to ->free_inode()") Fixes: 333f7909a857 ("coallocate socket_sq with socket itself") Signed-off-by: SeongJae Park --- net/socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/socket.c b/net/socket.c index e274ae4b45e4..27174021f47f 100644 --- a/net/socket.c +++ b/net/socket.c @@ -273,12 +273,12 @@ static struct inode *sock_alloc_inode(struct super_block *sb) return &ei->vfs_inode; } -static void sock_free_inode(struct inode *inode) +static void sock_destroy_inode(struct inode *inode) { struct socket_alloc *ei; ei = container_of(inode, struct socket_alloc, vfs_inode); - kfree(ei->socket.wq); + kfree_rcu(ei->socket.wq, rcu); kmem_cache_free(sock_inode_cachep, ei); } @@ -303,7 +303,7 @@ static void init_inodecache(void) static const struct super_operations sockfs_ops = { .alloc_inode = sock_alloc_inode, - .free_inode = sock_free_inode, + .destroy_inode = sock_destroy_inode, .statfs = simple_statfs, }; -- 2.17.1