歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> uclinux-2008R1-RC8(bf561)到VDSP5的移植(55):filemap.c的問題

uclinux-2008R1-RC8(bf561)到VDSP5的移植(55):filemap.c的問題

日期:2017/3/3 16:43:26   编辑:關於Linux

在VDSP下編譯mm/filemap.c時,發生了一個VDSP編譯器錯誤:

../../mm/filemap.c
At end of source: : internal error: Uncaught exception Assertion failed raised
at ../../../bril/optimiser/dominators.c:910 (in pass
cleanup_scalar_stores_nonopt during compilation of
_find_or_create_page). Please submit a bug report with this message,
the command line used, type of machine and the output of the
compiler when you add -ED -v to the command line. Please also send
us the pre-processed file that is generated by the -ED option (the
file generated is named <original_filename>.i)
1 catastrophic error detected in the compilation of "../../mm/filemap.c".
Compilation aborted.
cc3089: fatal error: Compilation failed

又是和優化相關的錯誤!

因為剛修改了find_or_create_page函數,直接在此函數中進一步排查,錯誤發生在下面這一行:

cached_page =__page_cache_alloc(gfp_mask);

在這裡cached_page是一個局部變量,而__page_cache_alloc則是一個內聯函數:

static inline struct page *__page_cache_alloc(gfp_t gfp)
{
  return alloc_pages(gfp, 0);
}

而alloc_pages是一個宏定義:

#define alloc_pages(gfp_mask, order) /
alloc_pages_node(numa_node_id(), gfp_mask, order)

調用alloc_pages_node函數:

static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, unsigned int order)
{
     if (unlikely(order >= MAX_ORDER))
         return NULL;

     /* Unknown node is current node */
     if (nid < 0)
         nid = numa_node_id();

     return __alloc_pages(gfp_mask, order,
         NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask));
}

不知道是不是連續兩個inline的調用造成了VDSP編譯的成敗?

從這一系列的調用過程可以看出,實際最後使用的是__alloc_pages函數,調用此函數時order參數為0。且由於不可能使用NUMA,因此nid實際為0。

因此直接將find_or_create_page函數中的調用改為:

cached_page = __alloc_pages(gfp_mask, 0,
NODE_DATA(0)->node_zonelists + gfp_zone(gfp_mask));

搞定!

Copyright © Linux教程網 All Rights Reserved