Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp173386iof; Mon, 6 Jun 2022 00:35:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC9tDHjIhGq6SbJLNsLN8yOcMZGbl4FnaHDqD3f05tXcHiiTlVrKh5GCmfFb3JCgDxCv0F X-Received: by 2002:a63:1e05:0:b0:3fd:9170:800d with SMTP id e5-20020a631e05000000b003fd9170800dmr6586759pge.586.1654500939090; Mon, 06 Jun 2022 00:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654500939; cv=none; d=google.com; s=arc-20160816; b=lR3zEf6NleA9PdsEPY00BpT8NemznOZEf9zAOyP3DFw1xrf81Mf2V4Mrh+lS4vCrhh kueTohMzrcy1Vfm0ylzziA8XHtY7YDyitLxtuBOarsTuxF2UY5blrxlySsMEfU8CT+Yf 0Ax9rR+sMD7DqxdVvoEXo5U5t9x2IxRBV1QAnOvlEMfo9wlgIYzqPju8Ba8Zb5WD2rjD Bifb43IFAGnhONlotEwN8McZB3bKQDeL50JsvGPYt8fr2Xkw1fQzrO+HF38EjrraDoyJ GWkG/DpfiYtvuwSh1fkm3d/MVxFQIMHg2ijBp2FOpHDPcThqU7UE+Uz8XKa+tesg9dqq 8eHg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=/g06ri91gcDq+dUl5GDKQbzhNsogCkqnJb9f6Snl5+Y=; b=QiFfS/8rONXN9WxCaOpzCscCxlqIb1+Q5B2bGq4OWkxgTQydS89u165PRqo6kGxa6H iuMUCamM/1aY1FoVR7uy0CjRlr0FyyZPQjYT6aUhK+nK/ULQ7jcZXdYUGKUbmdFNr7ye ZP2JCT4wFIdfJJ4BRTx4/nkTBtoC6rokCAILVtkHuiTTNInCQ8cnZrlxgxdkZzwbUVgO ZfC0EWwu3029z3psdRZ/NVuOjQnulBga2UemRvEe7Kfp2zBTBiqvQBjB8Ov4mM1DnRL2 MFrcyiwOz0lLQ3cNZbmFVvI4EJVy/C658VI1gxVKNqInwLrP/DreyS0KL2p0bX+KK2pg 7f5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=F2VQPWgH; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d1-20020a63f241000000b003db238f2a93si20529420pgk.815.2022.06.06.00.35.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 00:35:39 -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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=F2VQPWgH; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 259E815AB21; Mon, 6 Jun 2022 00:11:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbiFFHJm (ORCPT + 99 others); Mon, 6 Jun 2022 03:09:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230340AbiFFHJe (ORCPT ); Mon, 6 Jun 2022 03:09:34 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AB1C1483D0 for ; Mon, 6 Jun 2022 00:08:56 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id w2-20020a17090ac98200b001e0519fe5a8so11850160pjt.4 for ; Mon, 06 Jun 2022 00:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/g06ri91gcDq+dUl5GDKQbzhNsogCkqnJb9f6Snl5+Y=; b=F2VQPWgHZ8MelxSR29E7VbhkeMe49UxeXitK3UfHb8lvzzWzVwNYgJopaaHXHgx5Ph Ttr1NatH44PejImufLnSVTHjrY0k8QJVHRxZzmpRySezUGPWl1tT0LWZ9/pVo+++kSlD cVJEgCOGoGQMf1R40IxEIEOcERi6jDFBYc4cicK6wmFgn/jaJ7lxS1RUCKKYksYls17K alJ6ivV27ObyTX206FbgmE/GDMVEvF73yslAhyOs3ZcE+ZuV2Il8qkkG3C/d6k8bqd9P /KT7sKy+86QT8vi4hE7LMokguw3htg+Rxb9PPfvR8BleI3uz2owmSOdOhWvVYGlzi0fc 4gVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/g06ri91gcDq+dUl5GDKQbzhNsogCkqnJb9f6Snl5+Y=; b=sqpLS/XATKWG3zzW2dKk8GWMubm3Q5UBAZr9HSsNZbIMeeX9hHLrCsergyUQkFx0WR rnFjP2SWfqL9Yw3ChnebNovh9IYdJqZ8D/TM69JEEe02bYsLoMkE38ek4wd74bqtwQGx kQbiGZKvVilcPzFEEsrbysKX8t0NAZDeoLOYRLR6ZagZV2ImLu01zIETBVviU3GrMcJG iWx1t/b8PLmMYFCcNbC29aqyQHFym3rtlmuoJtjI8Zh6K6dM3i6sEgoFXHOvOebiCDN3 hClr5mgrz1rMWATph18dP9rihd2xKPd7NC1e3LxZvTxlkGwsT/W6iqW9goBwb30PqGNU UZgA== X-Gm-Message-State: AOAM533mjamdl185R2uA+vnHcFQKr9o9mnRezVrn4tde56HGjowD/Qwk BseNIItxE84LPKJ/57jfZq3r0A== X-Received: by 2002:a17:902:9a42:b0:158:bf91:ecec with SMTP id x2-20020a1709029a4200b00158bf91ececmr23160787plv.115.1654499332775; Mon, 06 Jun 2022 00:08:52 -0700 (PDT) Received: from FVFYT0MHHV2J.bytedance.net ([2408:8207:18da:2310:7cb7:47eb:4eca:56f3]) by smtp.gmail.com with ESMTPSA id z27-20020aa79e5b000000b0051bba3844d2sm9548497pfq.162.2022.06.06.00.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 00:08:52 -0700 (PDT) From: Muchun Song To: davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Muchun Song Subject: [PATCH] tcp: use kvmalloc_array() to allocate table_perturb Date: Mon, 6 Jun 2022 15:08:04 +0800 Message-Id: <20220606070804.40268-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 In our server, there may be no high order (>= 6) memory since we reserve lots of HugeTLB pages when booting. Then the system panic. So use kvmalloc_array() to allocate table_perturb. Signed-off-by: Muchun Song --- net/ipv4/inet_hashtables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index e8de5e699b3f..1ecbfdebc6bf 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c @@ -1026,8 +1026,8 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name, init_hashinfo_lhash2(h); /* this one is used for source ports of outgoing connections */ - table_perturb = kmalloc_array(INET_TABLE_PERTURB_SIZE, - sizeof(*table_perturb), GFP_KERNEL); + table_perturb = kvmalloc_array(INET_TABLE_PERTURB_SIZE, + sizeof(*table_perturb), GFP_KERNEL); if (!table_perturb) panic("TCP: failed to alloc table_perturb"); } -- 2.11.0