Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp717214imu; Fri, 16 Nov 2018 09:07:40 -0800 (PST) X-Google-Smtp-Source: AJdET5dssCEeq3Re0ZHHDhPj0NBj2uWzuf7c20xxKFUfffYbELdGOOkuzWaJQjILkiPbMa8Uiz5T X-Received: by 2002:a63:1848:: with SMTP id 8mr10571422pgy.81.1542388060717; Fri, 16 Nov 2018 09:07:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542388060; cv=none; d=google.com; s=arc-20160816; b=MWUuuOuQ8JNDCyu17n6BwZoAa4QqEHxa8RMs9/DJ4lNMRFHDCknLRFDPDwITusJ7qr tvSUTNk4rNu3gZzRoONlqr/H/juPfi9zQNbpSEdnU4n/PlAJzwPda1fDh6mRUgG5mw3p 77z1B4s9OaQUSEjMqF0RwkjttTGE8FJ7eUmOikWKWqzuvJiaaJZhXS3p0Lfc4G+Vmd7d M7UJvPakVK2DfPI021UjShkHUyHKAJ/4Wy5ZyEu0yxAzfFhPwqTHQ1ozqEzM/NOnysPQ EXdw+xAr1Rz4J78OvaYyP8bsUWxVLnxq/ln1bh9fLhVOgE9d1H1mCNPij6bBvyvycjMO Rejw== 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; bh=v2wcLy59keompcwGm3qXLYtXy5Ts/u3DBM/Y+s9TdIQ=; b=sNJr09r6ueh0abXPIyK0ex8SV+GkMozejolLfUDAFiRBYgX6IYld1oCVdlzZSSH0U8 6M8v4n+ysTc3xzEsoAlStkmtRLiOqLnTmbPjdbsYvklgjlarDXymF21tb1GX5sliYQzF deHkkPfXUDkqsCX8wv/XkPxIL9apZA8IJndQSPsQE8BcIeuhKuJHullooVXhWChERnts jKNWY/2an5EwF1T/Adhvdjw08vu1Wk2w1hg714oKz7lOGjwpUkKQmuHb8nbCL/2tNODb WLw6a0YD4br+/dqNBrCUoI4ScDXpe1A4sXU3vUw7Qu/hCzcg4JGKvkSMvR1ND3urUk5f RsAQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r22si1631615pgl.537.2018.11.16.09.07.25; Fri, 16 Nov 2018 09:07:40 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390183AbeKQDRV (ORCPT + 99 others); Fri, 16 Nov 2018 22:17:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:43300 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729036AbeKQDRU (ORCPT ); Fri, 16 Nov 2018 22:17:20 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 898BEB063; Fri, 16 Nov 2018 17:04:08 +0000 (UTC) Date: Fri, 16 Nov 2018 18:04:06 +0100 From: Michal Hocko To: Christopher Lameter Cc: Masahiro Yamada , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] slab: fix 'dubious: x & !y' warning from Sparse Message-ID: <20181116170406.GM14706@dhcp22.suse.cz> References: <1542346829-31063-1-git-send-email-yamada.masahiro@socionext.com> <010001671cca4b8b-2333373d-6b28-44e1-bca3-24570b8e0d2b-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <010001671cca4b8b-2333373d-6b28-44e1-bca3-24570b8e0d2b-000000@email.amazonses.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 16-11-18 13:51:19, Cristopher Lameter wrote: > On Fri, 16 Nov 2018, Masahiro Yamada wrote: > > > diff --git a/include/linux/slab.h b/include/linux/slab.h > > index 918f374..d395c73 100644 > > --- a/include/linux/slab.h > > +++ b/include/linux/slab.h > > @@ -329,7 +329,7 @@ static __always_inline enum kmalloc_cache_type kmalloc_type(gfp_t flags) > > * If an allocation is both __GFP_DMA and __GFP_RECLAIMABLE, return > > * KMALLOC_DMA and effectively ignore __GFP_RECLAIMABLE > > */ > > - return type_dma + (is_reclaimable & !is_dma) * KMALLOC_RECLAIM; > > + return type_dma + (is_reclaimable && !is_dma) * KMALLOC_RECLAIM; > > } > > Ok then lets revert the initial patch whose point was to avoid a branch. > && causes a branch again. I believe Vlastimil managed to get rid of the branch http://lkml.kernel.org/r/aa5975b6-58ed-5a3e-7de1-4b1384f88457@suse.cz -- Michal Hocko SUSE Labs