Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752029Ab2KFNyN (ORCPT ); Tue, 6 Nov 2012 08:54:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52409 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750989Ab2KFNyM (ORCPT ); Tue, 6 Nov 2012 08:54:12 -0500 Date: Tue, 6 Nov 2012 08:54:02 -0500 From: Dave Jones To: Hugh Dickins Cc: Andrew Morton , Johannes Weiner , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tmpfs: fix shmem_getpage_gfp VM_BUG_ON Message-ID: <20121106135402.GA3543@redhat.com> Mail-Followup-To: Dave Jones , Hugh Dickins , Andrew Morton , Johannes Weiner , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20121025023738.GA27001@redhat.com> <20121101191052.GA5884@redhat.com> <20121101232030.GA25519@redhat.com> <20121102014336.GA1727@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3484 Lines: 70 On Mon, Nov 05, 2012 at 05:32:41PM -0800, Hugh Dickins wrote: > - /* We already confirmed swap, and make no allocation */ > - VM_BUG_ON(error); > + /* > + * We already confirmed swap under page lock, and make > + * no memory allocation here, so usually no possibility > + * of error; but free_swap_and_cache() only trylocks a > + * page, so it is just possible that the entry has been > + * truncated or holepunched since swap was confirmed. > + * shmem_undo_range() will have done some of the > + * unaccounting, now delete_from_swap_cache() will do > + * the rest (including mem_cgroup_uncharge_swapcache). > + * Reset swap.val? No, leave it so "failed" goes back to > + * "repeat": reading a hole and writing should succeed. > + */ > + if (error) { > + VM_BUG_ON(error != -ENOENT); > + delete_from_swap_cache(page); > + } > } I ran with this overnight, and still hit the (new!) VM_BUG_ON Perhaps we should print out what 'error' was too ? I'll rebuild with that.. ------------[ cut here ]------------ WARNING: at mm/shmem.c:1151 shmem_getpage_gfp+0xa5c/0xa70() Hardware name: 2012 Client Platform Modules linked in: fuse ipt_ULOG scsi_transport_iscsi binfmt_misc dn_rtmsg nfnetlink nfc caif_socket caif af_802154 phonet af_rxrpc can llc2 pppoe pppox ppp_generic slhc irda crc_ccitt rds af_key decnet rose x25 atm netrom appletalk ipx p8023 p8022 psnap llc ax25 lockd sunrpc bluetooth rfkill ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables gspca_ov519 gspca_main videodev kvm_intel usb_debug kvm crc32c_intel ghash_clmulni_intel microcode pcspkr i2c_i801 e1000e uinput i915 video i2c_algo_bit drm_kms_helper drm i2c_core Pid: 21798, comm: trinity-child4 Not tainted 3.7.0-rc4+ #54 Call Trace: [] warn_slowpath_common+0x7f/0xc0 [] warn_slowpath_null+0x1a/0x20 [] shmem_getpage_gfp+0xa5c/0xa70 [] ? shmem_getpage_gfp+0x29e/0xa70 [] shmem_fault+0x4f/0xa0 [] __do_fault+0x71/0x5c0 [] ? __lock_acquire+0x306/0x1ba0 [] ? local_clock+0x89/0xa0 [] handle_pte_fault+0x97/0xae0 [] ? sub_preempt_count+0x79/0xd0 [] ? delay_tsc+0xae/0x120 [] ? __const_udelay+0x28/0x30 [] handle_mm_fault+0x289/0x350 [] __do_page_fault+0x18e/0x530 [] ? getname_flags.part.32+0x30/0x150 [] ? getname_flags.part.32+0x30/0x150 [] ? set_track+0x8c/0x1a0 [] ? __slab_alloc+0x531/0x59e [] ? trace_hardirqs_on_caller+0x15d/0x1e0 [] ? rcu_user_exit+0xc9/0xf0 [] do_page_fault+0x2b/0x50 [] page_fault+0x28/0x30 [] ? strncpy_from_user+0x6c/0x120 [] getname_flags.part.32+0x86/0x150 [] getname+0x3a/0x60 [] sys_symlinkat+0x24/0x90 [] ? tracesys+0x7e/0xe6 [] tracesys+0xe1/0xe6 ---[ end trace 4ba438264ea16e97 ]--- Dave -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/