From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>,
Hans-Christian Egtvedt <egtvedt@samfundet.no>,
Felipe Balbi <balbi@ti.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: Re: [PATCH 3/3] page-flags: rectify forward declaration
Date: Tue, 22 Sep 2015 14:26:08 +0530 [thread overview]
Message-ID: <20150922085534.GA4122@sudip-pc> (raw)
In-Reply-To: <20150921153509.fef7ecdf313ef74307c43b65@linux-foundation.org>
On Mon, Sep 21, 2015 at 03:35:09PM -0700, Andrew Morton wrote:
> On Sat, 19 Sep 2015 22:42:59 +0530 Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
>
<snip>
>
> Is it fixable? Can we use the traditional define-before-using structure?
How about this:
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index ab1a0e9..d7a1055 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -133,6 +133,19 @@ enum pageflags {
#ifndef __GENERATING_BOUNDS_H
+/* Forward declarations */
+struct page;
+static inline int PageCompound(struct page *page);
+static inline int PageTail(struct page *page);
+static inline struct page *compound_head(struct page *page)
+{
+ unsigned long head = READ_ONCE(page->compound_head);
+
+ if (unlikely(head & 1))
+ return (struct page *) (head - 1);
+ return page;
+}
+
/* Page flags policies wrt compound pages */
#define PF_ANY(page, enforce) page
#define PF_HEAD(page, enforce) compound_head(page)
@@ -223,12 +236,6 @@ static inline int __TestClearPage##uname(struct page *page) { return 0; }
#define TESTSCFLAG_FALSE(uname) \
TESTSETFLAG_FALSE(uname) TESTCLEARFLAG_FALSE(uname)
-/* Forward declarations */
-struct page;
-static inline int PageCompound(struct page *page);
-static inline int PageTail(struct page *page);
-static struct page *compound_head(struct page *page);
-
__PAGEFLAG(Locked, locked, PF_NO_TAIL)
PAGEFLAG(Error, error, PF_NO_COMPOUND) TESTCLEARFLAG(Error, error, PF_NO_COMPOUND)
PAGEFLAG(Referenced, referenced, PF_HEAD)
@@ -450,15 +457,6 @@ static inline void clear_compound_head(struct page *page)
WRITE_ONCE(page->compound_head, 0);
}
-static inline struct page *compound_head(struct page *page)
-{
- unsigned long head = READ_ONCE(page->compound_head);
-
- if (unlikely(head & 1))
- return (struct page *) (head - 1);
- return page;
-}
-
static inline int PageCompound(struct page *page)
{
return PageHead(page) || PageTail(page);
---
It builds properly. Tested with allmodconfig of x86_64 and avr32.
>
> Also, I'm finding that the patch series introduces a pretty large
> bisection hole:
>
> include/linux/page-flags.h: In function 'PageYoung':
> include/linux/page-flags.h:327: error: implicit declaration of function 'PF_ANY'
> include/linux/page-flags.h:327: error: invalid type argument of '->' (have 'int')
> include/linux/page-flags.h:327: error: invalid type argument of '->' (have 'int')
>
> which later gets fixed up by
> page-flags-rectify-forward-declaration.patch.
How to test this? Should I apply them on top of v4.2 and bisect? And I
don't see any relation between the first two patches and this patch of
the series, then how does it fail in bisect? Am I missing something?
Confused.. :(
>
> Maybe it's time to do a wholesale refactoring of the patchset?
If this patch is the first in the series will that help?
And besides I got the auto mail from you that the patch is applied.
Now totally confused.. :(
regards
sudip
next prev parent reply other threads:[~2015-09-22 8:56 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-19 17:12 [PATCH 0/3] fix allmodconfig failure of avr32 Sudip Mukherjee
2015-09-19 17:12 ` [PATCH 1/3] avr32: fix build failure Sudip Mukherjee
2015-09-21 6:09 ` Hans-Christian Egtvedt
2015-09-21 6:39 ` Sudip Mukherjee
2015-09-21 7:33 ` Hans-Christian Egtvedt
2015-09-21 8:01 ` Sudip Mukherjee
2015-09-23 15:56 ` Sudip Mukherjee
2015-09-23 17:15 ` Hans-Christian Egtvedt
2015-09-24 10:23 ` Sudip Mukherjee
2015-09-19 17:12 ` [PATCH 2/3] usb: gadget: at91_udc: mention proper dependency Sudip Mukherjee
2015-09-20 16:15 ` Felipe Balbi
2015-09-21 11:10 ` Sudip Mukherjee
2015-09-23 15:52 ` Sudip Mukherjee
2015-09-30 16:04 ` Felipe Balbi
2015-09-30 16:24 ` Sudip Mukherjee
2015-09-30 16:34 ` Nicolas Ferre
2015-09-30 16:53 ` Sudip Mukherjee
2015-09-30 17:12 ` Nicolas Ferre
2015-10-01 12:56 ` Sudip Mukherjee
2015-10-01 16:12 ` Sudip Mukherjee
2015-09-19 17:12 ` [PATCH 3/3] page-flags: rectify forward declaration Sudip Mukherjee
2015-09-21 22:35 ` Andrew Morton
2015-09-22 8:56 ` Sudip Mukherjee [this message]
2015-09-24 15:27 ` Sudip Mukherjee
2015-09-24 14:50 ` [PATCH 00/16] Refreshed page-flags patchset Kirill A. Shutemov
2015-09-24 14:50 ` [PATCH 01/16] page-flags: trivial cleanup for PageTrans* helpers Kirill A. Shutemov
2015-09-24 15:44 ` Christoph Lameter
2015-09-24 14:50 ` [PATCH 02/16] page-flags: move code around Kirill A. Shutemov
2015-09-24 14:50 ` [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages Kirill A. Shutemov
2015-09-25 12:29 ` Konstantin Khlebnikov
2015-09-25 19:13 ` Kirill A. Shutemov
2015-09-28 10:02 ` Konstantin Khlebnikov
2015-09-28 11:03 ` Kirill A. Shutemov
2015-09-28 11:48 ` Konstantin Khlebnikov
2015-09-28 17:51 ` Kirill A. Shutemov
2015-09-24 14:50 ` [PATCH 04/16] page-flags: define PG_locked behavior on " Kirill A. Shutemov
2015-09-24 16:08 ` Christoph Lameter
2015-09-24 20:26 ` Kirill A. Shutemov
2015-09-24 14:50 ` [PATCH 05/16] page-flags: define behavior of FS/IO-related flags " Kirill A. Shutemov
2015-09-24 14:50 ` [PATCH 06/16] page-flags: define behavior of LRU-related " Kirill A. Shutemov
2015-09-24 14:50 ` [PATCH 07/16] page-flags: define behavior SL*B-related " Kirill A. Shutemov
2015-09-24 14:50 ` [PATCH 08/16] page-flags: define behavior of Xen-related " Kirill A. Shutemov
2015-09-24 14:50 ` [PATCH 09/16] page-flags: define PG_reserved behavior " Kirill A. Shutemov
2015-09-24 14:50 ` [PATCH 10/16] page-flags: define PG_swapbacked " Kirill A. Shutemov
2015-09-24 14:50 ` [PATCH 11/16] page-flags: define PG_swapcache " Kirill A. Shutemov
2015-09-24 14:51 ` [PATCH 12/16] page-flags: define PG_mlocked " Kirill A. Shutemov
2016-04-18 19:44 ` Sasha Levin
2016-05-18 14:02 ` Kirill A. Shutemov
2015-09-24 14:51 ` [PATCH 13/16] page-flags: define PG_uncached " Kirill A. Shutemov
2015-09-24 14:51 ` [PATCH 14/16] page-flags: define PG_uptodate " Kirill A. Shutemov
2015-09-24 14:51 ` [PATCH 15/16] page-flags: look at head page if the flag is encoded in page->mapping Kirill A. Shutemov
2015-09-24 14:51 ` [PATCH 16/16] mm: sanitize page->mapping for tail pages Kirill A. Shutemov
2015-09-25 2:20 ` Jerome Glisse
2015-09-24 16:13 ` [PATCH 00/16] Refreshed page-flags patchset Christoph Lameter
2015-09-24 20:25 ` Kirill A. Shutemov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150922085534.GA4122@sudip-pc \
--to=sudipm.mukherjee@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=balbi@ti.com \
--cc=egtvedt@samfundet.no \
--cc=gregkh@linuxfoundation.org \
--cc=hskinnemoen@gmail.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).