Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5502553imm; Mon, 23 Jul 2018 00:21:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeMU9bOaMnBGa5GG5tbzEzLQPZjQtwMm1+b70AI/URAKN3rQx4NYpW8UF6vF+ZizKREPi+g X-Received: by 2002:a17:902:a716:: with SMTP id w22-v6mr11726876plq.271.1532330460450; Mon, 23 Jul 2018 00:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532330460; cv=none; d=google.com; s=arc-20160816; b=tD2WtCOyS0nGf9KYscIJWBGrAZIe39tl67wyhSZRMacw9yjwNOydwkljqLac40tFmy ml9nA5rbzlIqV9DOvJVCYk3G5kzKzQoReJEdsGdGNyDF9ffbmcdQL7BwFaNBbH8ecYMI RQRzd6bx/k6+yeGMGZo5r7eAV1cjIFNJyPmsdRjbMisLueND0eQDfVgXpOHbEob3Jl3H Evk89lv9wrtRMOyRPpB6H0Cc8e5k24NquheImdn+dmFG6EJmqspF52CuUbfFWOBHWDBd 8OCmfgAZ7wH5TiyV2zlVo/wE9bHzM61Onac66n+GJlpBzN5NT0HNRdMlM1+2YTP3TbLK dKdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=piyeUeuKVZqYH6l60dXwgx5SH0c13S1Bs4DKux0Nm2Y=; b=oE7WiKSbYdsjf1Mi5941TroDOJSYQikXRc9e4rhKGvcOzpRTJ5DF+Vn1w44TBOw8FM +r6HEYP0iUQEnWwY/m9sKTGlsMGbw40I46dK+3239V2gnIlUFmPLYQRrSenIwbMe8QDP fcw2UWUET+jArpDnBjAy1qB4JANMg9x4zgHXa5sAa1tNA2zXIiCb8UxVU1BS2+zEhAw+ vfVeikzv6VtmqZ+gY8fZkiTVI1NofxruO8gXhOdP5Ox3P2TM28rnJwFTGGngup76uc/A gUjPWdisvD35Gv2BvEjdaQXJQaV8KH8R7P6V23WuvJyd7FXZm8MLlrfmZCofBX9NrdhB 4JXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HM3kzBOG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m76-v6si8084405pfg.323.2018.07.23.00.20.45; Mon, 23 Jul 2018 00:21:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HM3kzBOG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387963AbeGWITe (ORCPT + 99 others); Mon, 23 Jul 2018 04:19:34 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40928 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387840AbeGWITe (ORCPT ); Mon, 23 Jul 2018 04:19:34 -0400 Received: by mail-pg1-f195.google.com with SMTP id x5-v6so11603498pgp.7; Mon, 23 Jul 2018 00:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=piyeUeuKVZqYH6l60dXwgx5SH0c13S1Bs4DKux0Nm2Y=; b=HM3kzBOGSeik18/6xVvXdJ/YmRpZTnnXbD1neZsvAJtYya4kYsdzOQbakZqGLfHQzN IsIpPBfgz7XYzaOSX9VcJmfBLZ3V+UpYGQ7OCo9LxnrD4Y2EDjalI7QY2/MALkvgH/F/ nAELygO1T0fIl0EglmEO2UXNh0gHOqgCX4VBTd19qFQ8U210BlVL/gweP/oznG8saX91 j6TwavDaYey7hiSYfafldMttTEHQmARiSUTc9csRHesZB5Il3Ms9Z4woil3R15zSQ76I 8haZMv1PdlcubVvTi5Hj1qN9A/VAb69e+Z4oqGcVFOl8U5bobpggHdjJ2n4oItGUwpm3 OxvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=piyeUeuKVZqYH6l60dXwgx5SH0c13S1Bs4DKux0Nm2Y=; b=r072mRkeIO+CXIi74+57SFH2QrAUPnnX8p+SeEkjVycMvUFcdUNRty+RqPDqM3QcyK q7HnJnUNpZL75yytcwWQ6m7rpsCIXujNqpja1TlSwW/lO/gk2G3ycyLzyzdV2gV8dbwU QTL+WpTVpVO2fCiOEFjnqMm1XQb3CvTTe+ZZdSesnQY7JnGj68C73/k+h/5RBBbyUzmk DncSMyvyorJNPKCDR7WoNQEAlwxXiaptsX+2MbQ67QFLzPGNHGREYP8sUWNhiGVlTarH GrpfAtOkDjuGJ+Ae55kxqhE3/MaLvJHUOR+XT6GJ2y+CgComdoEfgjMa6U8zdVcwqswV nAdg== X-Gm-Message-State: AOUpUlG6/VHIqNCckIo/o2+xcsGveUX5d/oWLXvir5fx4DXDHKJII9eL pYqKrOqlSPJNJmLSLowykBo2nc/t X-Received: by 2002:a62:20d8:: with SMTP id m85-v6mr12228742pfj.74.1532330386136; Mon, 23 Jul 2018 00:19:46 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:101.5.211.5? ([2402:f000:1:1501:200:5efe:6505:d305]) by smtp.gmail.com with ESMTPSA id 5-v6sm13539755pgc.86.2018.07.23.00.19.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 00:19:45 -0700 (PDT) Subject: Re: [REPORT] Possible unnecessary usages of GFP_ATOMIC in crypto/ablkcipher.c To: Herbert Xu Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org References: <78a7d726-f2fa-3afb-3451-bbd51a41a48a@gmail.com> <20180723062101.zzm5royyjfda6jma@gondor.apana.org.au> From: Jia-Ju Bai Message-ID: Date: Mon, 23 Jul 2018 15:19:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180723062101.zzm5royyjfda6jma@gondor.apana.org.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/7/23 14:21, Herbert Xu wrote: > On Mon, Jul 23, 2018 at 10:39:40AM +0800, Jia-Ju Bai wrote: >> My tool DCNS reports three unnecessary usages of GFP_ATOMIC in >> crypto/ablkcipher.c: >> crypto/ablkcipher.c, 162: kmalloc(GFP_ATOMIC) in ablkcipher_next_slow >> crypto/ablkcipher.c, 199: kmalloc(GFP_ATOMIC) in ablkcipher_copy_iv >> crypto/ablkcipher.c, 315: kmalloc(GFP_ATOMIC) in setkey_unaligned >> >> I meant to manually check the code, but I find that there are many functions >> calling ablkcipher_next_slow(), >> ablkcipher_copy_iv() and setkey_unaligned(), so I am not sure whether the >> above three reports are true. >> >> Could someone help me to validate these reports? >> Thanks a lot in advance :) > They must use GFP_ATOMIC because they can be called from softirq > context, e.g., IPsec. Okay, thanks for the reply. Best wishes, Jia-Ju Bai