Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965399AbcCOOQV (ORCPT ); Tue, 15 Mar 2016 10:16:21 -0400 Received: from a.ns.miles-group.at ([95.130.255.143]:11949 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754106AbcCOOQQ (ORCPT ); Tue, 15 Mar 2016 10:16:16 -0400 To: linux-fsdevel Cc: "linux-mtd@lists.infradead.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Boris Brezillon , Maxime Ripard , David Gstir , Dave Chinner , Artem Bityutskiy , "Kirill A. Shutemov" , Artem Bityutskiy , Alexander Kaplan From: Richard Weinberger Subject: Page migration issue with UBIFS Message-ID: <56E8192B.5030008@nod.at> Date: Tue, 15 Mar 2016 15:16:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3238 Lines: 54 Hi! We're facing this issue from 2014 on UBIFS: http://www.spinics.net/lists/linux-fsdevel/msg79941.html So sum up: UBIFS does not allow pages directly marked as dirty. It want's everyone to do it via UBIFS's ->wirte_end() and ->page_mkwirte() functions. This assumption *seems* to be violated by CMA which migrates pages. UBIFS enforces this because it has to account free space on the flash, in UBIFS speak "budget", for details please see fs/ubifs/file.c. As in the report from 2014 the page is writable but not dirty. The kernel has this debug patch applied: http://www.spinics.net/lists/linux-fsdevel/msg80471.html But our kernel is based on v4.4 and does *not* use proprietary modules. [ 213.450000] page:debe03c0 count:3 mapcount:1 mapping:dce4b5fc index:0x2f [ 213.460000] flags: 0x9(locked|uptodate) [ 213.460000] page dumped because: try_to_unmap_one [ 213.470000] pte_write: 1 [ 213.480000] UBIFS assert failed in ubifs_set_page_dirty at 1451 (pid 436) [ 213.490000] CPU: 0 PID: 436 Comm: drm-stress-test Not tainted 4.4.4-00176-geaa802524636-dirty #1008 [ 213.490000] Hardware name: Allwinner sun4i/sun5i Families [ 213.490000] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 213.490000] [] (show_stack) from [] (dump_stack+0x8c/0xa0) [ 213.490000] [] (dump_stack) from [] (ubifs_set_page_dirty+0x44/0x50) [ 213.490000] [] (ubifs_set_page_dirty) from [] (try_to_unmap_one+0x10c/0x3a8) [ 213.490000] [] (try_to_unmap_one) from [] (rmap_walk+0xb4/0x290) [ 213.490000] [] (rmap_walk) from [] (try_to_unmap+0x64/0x80) [ 213.490000] [] (try_to_unmap) from [] (migrate_pages+0x328/0x7a0) [ 213.490000] [] (migrate_pages) from [] (alloc_contig_range+0x168/0x2f4) [ 213.490000] [] (alloc_contig_range) from [] (cma_alloc+0x170/0x2c0) [ 213.490000] [] (cma_alloc) from [] (__alloc_from_contiguous+0x38/0xd8) [ 213.490000] [] (__alloc_from_contiguous) from [] (__dma_alloc+0x23c/0x274) [ 213.490000] [] (__dma_alloc) from [] (arm_dma_alloc+0x54/0x5c) [ 213.490000] [] (arm_dma_alloc) from [] (drm_gem_cma_create+0xb8/0xf0) [ 213.490000] [] (drm_gem_cma_create) from [] (drm_gem_cma_create_with_handle+0x1c/0xe8) [ 213.490000] [] (drm_gem_cma_create_with_handle) from [] (drm_gem_cma_dumb_create+0x3c/0x48) [ 213.490000] [] (drm_gem_cma_dumb_create) from [] (drm_ioctl+0x12c/0x444) [ 213.490000] [] (drm_ioctl) from [] (do_vfs_ioctl+0x3f4/0x614) [ 213.490000] [] (do_vfs_ioctl) from [] (SyS_ioctl+0x34/0x5c) [ 213.490000] [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x34) The full kernellog can be found here: http://code.bulix.org/ysuo9x-93716?raw So, let me repeat Artem's question from 2014: > Now the question is: is it UBIFS which has incorrect assumptions, or this is the > Linux MM which is not doing the right thing? I do not know the answer, let's see > if the MM list may give us a clue. Thanks, //richard