Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp445598rdh; Thu, 23 Nov 2023 08:07:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTC2iZ+BVk+DVtdFaMHghFshmP6cY0+T5AqT0SsZ3eBEF7KVvkvToIuKUp2ChLyRVp5QCR X-Received: by 2002:a17:90b:3b85:b0:27d:1d1f:1551 with SMTP id pc5-20020a17090b3b8500b0027d1d1f1551mr6136822pjb.29.1700755630551; Thu, 23 Nov 2023 08:07:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700755630; cv=none; d=google.com; s=arc-20160816; b=xgJd58dJIajIPWBAZHRRi00IBclquUGOhMDFyGKbeu4So6ztNe/+3nhV1hEu4Hjj+3 P4kxOHT1TbP9lrWzSws2YcLUbke5R/qjPifzsX8gv+H7kOcmmHFL2e8XJhPkcPB6DCRL U/k5B34WtfzevweAxem7qhEB6rGhe8f4RDlt3KDOec5OOoEfHap/q1ojFU9qR9bBQwR3 /gr6j4vpJDNmGOwa+2BCeNCSdV66VsQCHTdKAgkpH5QBfpPKKNb+JMK8pLgL16KGtAqj 0LJFcjB1ijzZSstuEt225rscodNOH4kJdtbDPwBs3RWNDfU6O3MtZpACPffrrwArOH3M ZzoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PBfkuN+8kqgz4YwTIPKlrUbx6SBXFOUPuEOnMG73eBs=; fh=/tVN5BJP0qh+yRkTOCGie05XZWM49P5dn1+TI0V9M74=; b=K6rMW80EVJ7x2GUeCohF1F2d5l4fZHpb0IxtDCP0zU9hVgqzNhshi7txS4FU/Tk+ZF 70dAGO8fUkpknt1snEILB9+NaIFp9AxmpaG2jg9bP634rhw7JMteccc/8bdTQcyBOvfK 9qg1xMCNdxVz6NuU3tgsa8A+5TBmQvskpAIHJZ+GR1tub+UC43wvNz23Bn55kIZxtsup 5l48gOzcD9WDkHm4v3OpRbezm3ufkYG5gwB5n5rQnj9swlf8JekFwMqwv6d+1TdBUEyZ e/GXazeuaURZLKTfXV8XPGqXCbYRPT5Q+UCM811IjpcTXFemSem+PFhfrbQ/9Mn4eCLg aYqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Qb9/6LIs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id k1-20020a17090a9d8100b0028025d519cfsi2069356pjp.177.2023.11.23.08.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 08:07:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Qb9/6LIs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DA37B828F23B; Thu, 23 Nov 2023 08:07:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229835AbjKWQGr (ORCPT + 99 others); Thu, 23 Nov 2023 11:06:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbjKWQGp (ORCPT ); Thu, 23 Nov 2023 11:06:45 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E2BDD43 for ; Thu, 23 Nov 2023 08:06:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700755611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PBfkuN+8kqgz4YwTIPKlrUbx6SBXFOUPuEOnMG73eBs=; b=Qb9/6LIsuEj5O+T/wZ9SCNlujw00fqhfS1cown3/c9RtG1+JzZVB9Tp/sIYKkB/WGyk2W9 mNekAEgcVnoG5XjPP4lY1Oce+DZetbPf+l9ghO3sUJI1mHXAOyU/xTDbBhvLEn3siifyp7 FxQRiPNJHb2UwEINYwEVb5nVNaiLLFo= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-2-hdlM9_1cPtWIgmbmiCMmeg-1; Thu, 23 Nov 2023 11:05:46 -0500 X-MC-Unique: hdlM9_1cPtWIgmbmiCMmeg-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-67a05428cceso1915336d6.0 for ; Thu, 23 Nov 2023 08:05:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700755545; x=1701360345; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PBfkuN+8kqgz4YwTIPKlrUbx6SBXFOUPuEOnMG73eBs=; b=SRqiwncS1XaTp1lstEtPsI0Qi3H/icau1RBLz0/7kVXxGl62aMIyNrkRLdnWf9O/xj OUa8hN4ym5JBbcXmbCUWQEntPw/fPxM4emxrGFIbMPNvk9p4K692L/sEChLazQ50APDI CE+bbz7W61r3Xjk8ytT90Wwk04Xm3UULB65GbTCZaHuHZvMJ1S2qQx88cp3V2rLKNDAm 3eBI6aLU7Ttjc2HHCZabQU9nYe+b9dLI1mEvd5zNkPS4P5WH2EMnY9+VOWbafTGo58FI uk9wl1BElDGv3s7pIvAgNihdG9vr+yJAFrHsxAq13r/w+j43XIL98T6z9UlVzvazVjAW Jgqg== X-Gm-Message-State: AOJu0YzfjkSxFEo3VFbN4ATq3rhdNY+OgxBYH0VW6+KLRWfnwreEP64G +DGCa7dwg21bKt6iQ1nZgG/V5cJRvzrsaAGIpw6Jl0dKJ7O6T+MTJ8NO7cvRKllzuSU0VXIyx4S UXjaQFYaXGAav7PbZgqZe/xKi X-Received: by 2002:a05:6214:7f0:b0:67a:826:df8c with SMTP id bp16-20020a05621407f000b0067a0826df8cmr1824360qvb.3.1700755545591; Thu, 23 Nov 2023 08:05:45 -0800 (PST) X-Received: by 2002:a05:6214:7f0:b0:67a:826:df8c with SMTP id bp16-20020a05621407f000b0067a0826df8cmr1824326qvb.3.1700755545264; Thu, 23 Nov 2023 08:05:45 -0800 (PST) Received: from x1n (cpe688f2e2cb7c3-cm688f2e2cb7c0.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id n11-20020ad444ab000000b0067a08bba0bbsm519516qvt.0.2023.11.23.08.05.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 08:05:45 -0800 (PST) Date: Thu, 23 Nov 2023 11:05:42 -0500 From: Peter Xu To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mike Kravetz , "Kirill A . Shutemov" , Lorenzo Stoakes , Axel Rasmussen , Matthew Wilcox , John Hubbard , Mike Rapoport , Hugh Dickins , David Hildenbrand , Andrea Arcangeli , Rik van Riel , James Houghton , Yang Shi , Jason Gunthorpe , Vlastimil Babka , Andrew Morton Subject: Re: [PATCH RFC 01/12] mm/hugetlb: Export hugetlbfs_pagecache_present() Message-ID: References: <20231116012908.392077-1-peterx@redhat.com> <20231116012908.392077-2-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 23 Nov 2023 08:07:03 -0800 (PST) On Wed, Nov 22, 2023 at 11:23:07PM -0800, Christoph Hellwig wrote: > You're (thankfully) not actually exporting anything, so please > don't claim that in the subject. Ah, I'll rename the subject to "mm/hugetlb: Declare hugetlbfs_pagecache_present() non-static". > > > pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma, > > unsigned long addr, pud_t *pud); > > +bool hugetlbfs_pagecache_present(struct hstate *h, > > + struct vm_area_struct *vma, > > + unsigned long address); > > Can you just follow the much more readable two tab indent of the > function above? > > > -static bool hugetlbfs_pagecache_present(struct hstate *h, > > - struct vm_area_struct *vma, unsigned long address) > > +bool hugetlbfs_pagecache_present(struct hstate *h, > > + struct vm_area_struct *vma, unsigned long address) > > Same here. The new indentation not only is less readable but also > creates a pointlessly overlong line. I can easily follow what you suggest for this single patch, but afaict the kernel doesn't document that in the style guide. https://www.kernel.org/doc/html/v4.10/process/coding-style.html#functions And the reality is at least across mm codes it's used in a mixture of ways, even more than these two major forms of indentations. To be explicit, I think 2-tab is Vim's default, while this patch follows Emacs's c-mode default. It means if this patch indents wrongly, probably 99% of Emacs users are doomed. :( Before we have a clear and thorough rule over this, shall we just allow either sane indent to still be accepted? Or maybe there's some rule that I have missed? Personally I actually prefer Emacs's indentations to align with left bracket, but that's just subjective so doesn't count. Thanks, -- Peter Xu