Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4074961imu; Mon, 24 Dec 2018 15:14:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/UauUhKKILs6s04OoLYEe7V7M+TMqLKUg7OiKxeCOpqgTcxxIxnu0472HQtMof8YndLOnEL X-Received: by 2002:a62:cf84:: with SMTP id b126mr14568957pfg.98.1545693285542; Mon, 24 Dec 2018 15:14:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545693285; cv=none; d=google.com; s=arc-20160816; b=SEkFYar03yFvbcg1Z6MDSfUpJNUn4Wzj7qoRLXePce1czfUBsSJ3OsCrMsGv7j6LCY DnlHt4N4qv0INXfWqCvMmUq0hREGUwCuZUZxKSVsgCZGFs1TEff8I/UObJgQnkrFr8hK TXKze1vz6aezKQtisEBB5ic5Pj1jikM4OPZH/kCtHta9elSYLYVVjNkAxQG85o+jylip ix4plug6Qig8f5JiD5pkLRdNiItmVqxsRS877JrOwz5UH/TgZeiAJO3CoNQbh5mJRuFX 1IVL0MhYLk2fNFsfTyLEv9FkMQoqLQadIOut176pX0dJfTRKh2MZI/AQX0+19+d37PKW 0B+g== 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:dkim-signature; bh=VnsvBREq9o+zfsWgqB6eTBoRuDqOLjY+Nyv6Il1PQ7g=; b=X5zaT5N1FZkbRH+hM/5i71CXCr35bOudfVyvXGQhYvmk4wTBpEZ76CtASSCQWIji/Z uLO6hI7XNHeu90aT/cBeNsFKBwIo+VqavUkOE4MXGSVsJNj7kPf6w/hkkoJ/Mip4Lu6E MhP1G/G6OGZvPHJmpX2U6df7ERpcaf62ZEy7iTBbam2XixkKSRttJ7fThisCHxjFsfzF bTwdjv0eK6DQ9EiEcbJ5t2kLSuKnleXm1e+a0Fh9JYNpcqRxAtSCA0TD9kOZ7K8ovc+2 GTn8XiVKU/iWVkLYgmmuqMMdU98j2ey7TPP2F8+0Rqop6a9J0uez0iFChpl7WbWEnoqe H2wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=RgF+01Pp; 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 k13si12204740pgb.343.2018.12.24.15.14.30; Mon, 24 Dec 2018 15:14:45 -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; dkim=pass header.i=@ziepe.ca header.s=google header.b=RgF+01Pp; 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 S1725866AbeLXXMc (ORCPT + 99 others); Mon, 24 Dec 2018 18:12:32 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:35648 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbeLXXMb (ORCPT ); Mon, 24 Dec 2018 18:12:31 -0500 Received: by mail-pl1-f195.google.com with SMTP id p8so5997233plo.2 for ; Mon, 24 Dec 2018 15:12:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VnsvBREq9o+zfsWgqB6eTBoRuDqOLjY+Nyv6Il1PQ7g=; b=RgF+01PpEEnQu/GNPM/NUIkEYDWnhTDsWxA+AUIrhGbefyNVtM5BUtGowVgtjsjh+2 9TtCFTsiUDvrtX0+4m3p+cyMfi+VqYfZSUoQyIRNauC0WxaBnT055dS5JMICHvahkJQS FLle3W4HfP6Iicvi5cZKrqUkKMf8+gm5mqBPLPodJuipCaNUC4nFTZMbzJybXTOeh/2R dD2a0dkXtwmuo1DGVetJVREplay3GKe+uzAN+Rq3t5H4Bt2szB3lSfevArkAU90KUpHZ basCRVRT/n2szJyKve264wovaqOqp9qe/eB2WHbNwEZjf8vXe7OdKbHdbb5rQtHUNXxM Vtrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VnsvBREq9o+zfsWgqB6eTBoRuDqOLjY+Nyv6Il1PQ7g=; b=S2D4G42FckcGYcEaJB7uEB9go47VraZgsgd/DfpT76lv1palotSWLv+ItkDfRlrM7s SLcyohQ0g0P6KrTDxmQ0r8k2gdWwjbTG44JweHZ/1VcjqxrQe3vjUHT2RCRPT3Je9Z9R MVV8L4kSL0jBTcXUycOCLf0HErwzWG15aZeLJapCnz0lKfPctVG+JR/EszvnAFSNynT3 AB+zV7OAQJuApNWO3lvtKVG9PyAmZVt6esPwVw+q+si9uYMxX8jg1O8MLNJESAzcjxFg WUNE6Gyrtev9vD4WN6YeEbVLgw0UGYza5JFySKgGAhm8FDty7fVt1l+JQTaXjgSiiqoT Bwtg== X-Gm-Message-State: AJcUukfMa/4tz483G0R+HpCifQVwgOwSvW1XGli5spF1pCic4O2ND/Rz gTVKO05AwJMtO6WM8YfFIX22Rw== X-Received: by 2002:a17:902:e290:: with SMTP id cf16mr14803496plb.81.1545693150829; Mon, 24 Dec 2018 15:12:30 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id 85sm49264066pfw.17.2018.12.24.15.12.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Dec 2018 15:12:29 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1gbZOe-0007bE-RZ; Mon, 24 Dec 2018 16:12:28 -0700 Date: Mon, 24 Dec 2018 16:12:28 -0700 From: Jason Gunthorpe To: Gal Pressman Cc: Joe Perches , Bart Van Assche , Stephen Warren , Tariq Toukan , xavier.huwei@huawei.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, Doug Ledford , Stephen Warren , Christoph Hellwig , Andrew Morton , Linus Torvalds , Jonathan Corbet , linux-kernel@vger.kernel.org Subject: Re: rfc: bool structure members (was Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent) Message-ID: <20181224231228.GB17036@ziepe.ca> References: <20181219182031.8675-1-swarren@wwwdotorg.org> <20181220174318.GA21404@ziepe.ca> <20181220174448.GA21149@lst.de> <1545328145.185366.500.camel@acm.org> <072c2d9d187daf0672bf54ab035e47a05fd1cd1d.camel@perches.com> <20181221033159.GF23877@ziepe.ca> <20181221235230.GC13168@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Sun, Dec 23, 2018 at 06:42:20PM +0200, Gal Pressman wrote: > On 22-Dec-18 01:52, Jason Gunthorpe wrote: > > On Thu, Dec 20, 2018 at 09:12:43PM -0800, Joe Perches wrote: > >> Care to submit a coding_style.rst patch or > >> improve the one below this? > > > > I took yours and revised it a little bit. I spent some time looking at > > assembly and decided to drop the performance note, the number of cases > > that run into overhead seems pretty small and probably already > > requires !! to be correct. There is also an equally unlikely gain, ie > > 'if (a & b)' optimizes a tiny bit better for bool types. > > > > I also added a small intro on bool, as I know some people are > > unfamiliar with C11 _Bool and might think bool is just '#define bool > > u8' > > > > (for those added to the cc) I'm looking at cases, like the patch that > > spawned this, where the struct has a single bool and no performance > > considerations. As CH said, seeing that get converted to int due to > > checkpatch is worse than having used bool. Using u8 won't make this > > struct smaller or faster. > > > > Since a "Using bool" section is added, perhaps it's worth documenting the bool > usage as a function parameter [1]? > > [1] https://www.spinics.net/lists/linux-rdma/msg72336.html I'm not really sure how to express that as something concrete.. That specific case clearly called out for a flags as it was a widely used API - maybe less spread out cases like static functions or something are OK?? Jason