Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5463370imm; Sun, 22 Jul 2018 23:22:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd7sa8SJ4nE1urHCV9mzFfGSBd5twzHP5IHS+es6STG91lDzFwrvrhWeKPaCLf2zt+3KepY X-Received: by 2002:a62:43c8:: with SMTP id l69-v6mr12074650pfi.196.1532326965740; Sun, 22 Jul 2018 23:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532326965; cv=none; d=google.com; s=arc-20160816; b=F0hnoffvXAWRFbxG+xW2ErKc98kNVgMbsK0YdBNnVyyN2xfw+zN+BsMwYma6QfJj3c GSZ5G56hzmviISh0SaMQx4qoqoeN6MSxSGc951ZIzcIEAf7EoeRA507Kv5oHhDcw1Zer 4nqNtyHCTuhG0z2rQUsPNCCPKZbFX0QnlZAKuXmIdTCIdseVV5OIxoNuL+Z0bSYaB0yB ZL+eXYkaEEUQCOTkasu2Ve+6X7TcIYtyvEGaG8WnUoTv7TDZsKJyx3/GXP+s0yW6HvNz acMHonylG7AwRltJE96xfngwsbmMsYxLqPN3C4xbQniRpbeY06KMmg0zlJTuugu0Epiq w5aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=VWzQfeKlOlGJ50JqWdABg8OXD+AOGcMwHFW7MdftXoo=; b=vhr8HetsTTCEA5b8eY/4iYw7lJ2ekf8lHicXzQ/TFP/lpa/NJQ0F5BrCxTF+cEyiXt RQVn13eRdXa0Oegop6PFbiIcCIqVY962fAS4ilMd+TXdeXuObt1+ldJ9+2W4+Y2Whr4r prtuOVndg2MyVEBgN7AiJr1hbThN2IOC5g3i9G4oo2xkJwRLTgnEM7mLUBhB67N0R+u5 IFqOiyiKLTkXaExV6h5Vmy9Moa4fgxwaw1zojV1mHMn8GVcFACB35idJplTumwYA44xn hQrPiu6OZ90rG7todbTPurbqXqD00sxI9qkP0XJH73dQ8Eyj4ezxs2N5ep9T/Qml+NOI R2jA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w24-v6si7189241plp.386.2018.07.22.23.22.30; Sun, 22 Jul 2018 23:22:45 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387930AbeGWHUj (ORCPT + 99 others); Mon, 23 Jul 2018 03:20:39 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:54230 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725976AbeGWHUj (ORCPT ); Mon, 23 Jul 2018 03:20:39 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1fhUDO-0000Tt-Ig; Mon, 23 Jul 2018 14:21:02 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1fhUDN-0002TR-Gb; Mon, 23 Jul 2018 14:21:01 +0800 Date: Mon, 23 Jul 2018 14:21:01 +0800 From: Herbert Xu To: Jia-Ju Bai Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [REPORT] Possible unnecessary usages of GFP_ATOMIC in crypto/ablkcipher.c Message-ID: <20180723062101.zzm5royyjfda6jma@gondor.apana.org.au> References: <78a7d726-f2fa-3afb-3451-bbd51a41a48a@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78a7d726-f2fa-3afb-3451-bbd51a41a48a@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt