Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4417916img; Tue, 26 Mar 2019 09:02:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaT+saguX1prwjgRfn7eb+P/itxgY4yMcptkpeSs6XAEwUinpwZYQLou6+AenYtSNJWeGj X-Received: by 2002:a17:902:7044:: with SMTP id h4mr24900723plt.274.1553616145773; Tue, 26 Mar 2019 09:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553616145; cv=none; d=google.com; s=arc-20160816; b=tx2lJfrHYlFAtu770R7VbeNmonFS6IjxVI+6FEshoT1bLw0evVs6ckeFM0owwJwoI8 S2cREk7A4caQgIzPKXlP/6zcYt/sosDoeGBthL2tN4+8xEPGvWp5s7JojpYLQOzl4tzR URd8ouuXwSGG8P6VYyu8W1MYWqwRL+vgv5A2wVTYCDqVn4JQRvSZcNj2JoDlC9zRjFoM CL1JMreDEvz+e/+cdqyl5oCZqKwjlRJfNLIttmasBY0olZ1/jZMhnffuPcBvHx7FObK0 r4II5wcE55MWnMWkMh3101WamO2EvurSilK7s6YSralKS4ybzER052T/8Ewcnx4W/IPC UEDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=5JSh85fk4kA2upwixVG2YsNhFipIv7bLyOUQWqffPOg=; b=MU+X0apFWk7p047bG6+08OOhknkovvnQwFaY7bwAyRoSB6ncdYjMEO3+1emSzAeatK ys1Cq0OLGPGQuJXmqMY7oC57Fn2y+LPDMjvJ2IjbNPi/kFTQWHOsyZqE5103iWs7bwVn 9b3Q7uc0xTq5IJWKoB0UtxdjU+yrER8getHrVp5Txq3RwaDSK88gFerpzjPqliq+QO72 OuCxud0okKhb/EUxOdcDwcAdUjHt5ZdMYxMFtDxqgsAssKSrWKWQGc+uYih+eVFCT1S9 4qAnhQzjLk5WA7EBbZgEMKr3gKYS31ke9xx89RQNp83YlLY1gIXmYtHoe9oXRsAfeJIc 8aGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=LlsVT94n; 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 p22si2533257pgi.449.2019.03.26.09.02.03; Tue, 26 Mar 2019 09:02:25 -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=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=LlsVT94n; 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 S1732023AbfCZQAw (ORCPT + 99 others); Tue, 26 Mar 2019 12:00:52 -0400 Received: from a9-34.smtp-out.amazonses.com ([54.240.9.34]:40334 "EHLO a9-34.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726278AbfCZQAv (ORCPT ); Tue, 26 Mar 2019 12:00:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1553616050; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=s/y64a9Nl0E1aNUlGJcS6EovFAznUXKfgfzvkfl1KBk=; b=LlsVT94ndQ0NoNjRQgTIrVbjQxe8YzPsYuPiQpjKIJZtSBFGGpwhN3YnGRKaH4L1 pvVtFPrksLbz5+CNWyzLImAaHw9X8AF1fkzV9rY3g01W9wiQM0Yqol3Ecy7XczT/96x BijQyM6zrcywzsOmTcDE2iCoQwNvJsZlJVDeJH+Y= Date: Tue, 26 Mar 2019 16:00:50 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Qian Cai cc: akpm@linux-foundation.org, catalin.marinas@arm.com, mhocko@kernel.org, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] kmemleaak: survive in a low-memory situation In-Reply-To: <20190326154338.20594-1-cai@lca.pw> Message-ID: <01000169babb99b8-b583bf57-5104-45b7-a4d6-e7677c64ece2-000000@email.amazonses.com> References: <20190326154338.20594-1-cai@lca.pw> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.03.26-54.240.9.34 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Mar 2019, Qian Cai wrote: > + if (!object) { > + /* > + * The tracked memory was allocated successful, if the kmemleak > + * object failed to allocate for some reasons, it ends up with > + * the whole kmemleak disabled, so let it success at all cost. "let it succeed at all costs" > + */ > + gfp = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : > + gfp_kmemleak_mask(gfp) | __GFP_DIRECT_RECLAIM; > + object = kmem_cache_alloc(object_cache, gfp); > + } > + > if (!object) { If the alloc must succeed then this check is no longer necessary.