Received: by 10.192.165.148 with SMTP id m20csp4892056imm; Tue, 24 Apr 2018 10:04:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoBv511jrmBLaXhJlRemuaD5i5UN+6+JXbZ/A26nF3F/S5cMM9/qiLmdStUI7JNaPZxycQd X-Received: by 10.101.74.209 with SMTP id c17mr2042263pgu.26.1524589451595; Tue, 24 Apr 2018 10:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524589451; cv=none; d=google.com; s=arc-20160816; b=CduDKgKPmORy+kLuV+tn1U+9j8LQBnc7dXpEAG20hJytNMiJF1duy8PZ3ZdMHaKhgi t/KvlqNwGFFWqpLL4Uo7dUHpI8+rUFIq4sradmX5Omar1p0XaqjXg1XSAS0kflCGlAqg 4nGAxbfxgVFuiKyNXO3HIbD3wfakTyxWGX5pUVC8K3UTsg+arvQc6K490kyxJkGSWfd2 hgiayuqoYBWk6InXAHzNmceOzmlBzxVtVDJdhQS+/9e+q/LazaWl+dYy6XWDsdHmwyBW hdpdum2o1Y0968RgGhHM3cFqw9yNxf9Zo3UjjZbjh1AfERODCdXLznn3pHqnmbFjmane wxTw== 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=yHcHTU+QhbEZNE/8hJiPTFScE3kKhGztafRSKcF5p+8=; b=fkzA1c1Q22cbC52ro2w+NrzuiKDNkaBZSEVVF/Fpm3+toxU33gANIMe9X2F5s7m7G8 w6k2STpzN09NgHrrwsd8/xw8//xcfekSyI1VtssPUegOHvikVuEjUqWhcxr2f6cyHDeX jq0GCmbPdhhSTHw0VNeYCtVP20LU9VNVNapPzP1DwJW/HROBeNrc0ZXcj2lZuoM9ozrc 3dxevZAF6d1MlnVpfm41HDOIcvxoh3KVrYlWszSMciRhpeqt0u4XjXS7d2mslZwDNt5I WB7QsxBLH8it6N8OxqDrA2lt6MUjhax6WSxEcwyQEpZcJaR1Xy+G6emQ272LHn6Gn7O1 +TRg== 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 k90si7688826pfh.50.2018.04.24.10.03.56; Tue, 24 Apr 2018 10:04:11 -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 S1751500AbeDXRCs (ORCPT + 99 others); Tue, 24 Apr 2018 13:02:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:43608 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751454AbeDXRCn (ORCPT ); Tue, 24 Apr 2018 13:02:43 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 31F92AC61; Tue, 24 Apr 2018 17:02:42 +0000 (UTC) Date: Tue, 24 Apr 2018 11:02:39 -0600 From: Michal Hocko To: Chunyu Hu Cc: Chunyu Hu , Dmitry Vyukov , Catalin Marinas , LKML , Linux-MM Subject: Re: [RFC] mm: kmemleak: replace __GFP_NOFAIL to GFP_NOWAIT in gfp_kmemleak_mask Message-ID: <20180424170239.GP17484@dhcp22.suse.cz> References: <1524243513-29118-1-git-send-email-chuhu@redhat.com> <20180420175023.3c4okuayrcul2bom@armageddon.cambridge.arm.com> <20180422125141.GF17484@dhcp22.suse.cz> <20180424132057.GE17484@dhcp22.suse.cz> <850575801.19606468.1524588530119.JavaMail.zimbra@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <850575801.19606468.1524588530119.JavaMail.zimbra@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 24-04-18 12:48:50, Chunyu Hu wrote: > > > ----- Original Message ----- > > From: "Michal Hocko" > > To: "Chunyu Hu" > > Cc: "Dmitry Vyukov" , "Catalin Marinas" , "Chunyu Hu" > > , "LKML" , "Linux-MM" > > Sent: Tuesday, April 24, 2018 9:20:57 PM > > Subject: Re: [RFC] mm: kmemleak: replace __GFP_NOFAIL to GFP_NOWAIT in gfp_kmemleak_mask > > > > On Mon 23-04-18 12:17:32, Chunyu Hu wrote: > > [...] > > > So if there is a new flag, it would be the 25th bits. > > > > No new flags please. Can you simply store a simple bool into fail_page_alloc > > and have save/restore api for that? > > Hi Michal, > > I still don't get your point. The original NOFAIL added in kmemleak was > for skipping fault injection in page/slab allocation for kmemleak object, > since kmemleak will disable itself until next reboot, whenever it hit an > allocation failure, in that case, it will lose effect to check kmemleak > in errer path rose by fault injection. But NOFAULT's effect is more than > skipping fault injection, it's also for hard allocation. So a dedicated flag > for skipping fault injection in specified slab/page allocation was mentioned. I am not familiar with the kmemleak all that much, but fiddling with the gfp_mask is a wrong way to achieve kmemleak specific action. I might be easilly wrong but I do not see any code that would restore the original gfp_mask down the kmem_cache_alloc path. > d9570ee3bd1d ("kmemleak: allow to coexist with fault injection") > > Do you mean something like below, with the save/store api? But looks like > to make it possible to skip a specified allocation, not global disabling, > a bool is not enough, and a gfp_flag is also needed. Maybe I missed something? Yes, this is essentially what I meant. It is still a global thing which is not all that great and if it matters then you can make it per task_struct. That really depends on the code flow here. -- Michal Hocko SUSE Labs