From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758658AbcIMQVW (ORCPT ); Tue, 13 Sep 2016 12:21:22 -0400 Received: from mga07.intel.com ([134.134.136.100]:22414 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754885AbcIMQVU (ORCPT ); Tue, 13 Sep 2016 12:21:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,329,1470726000"; d="scan'208";a="878323427" Subject: Re: [PATCH v2] mm, proc: Fix region lost in /proc/self/smaps To: Oleg Nesterov , Michal Hocko References: <1473649964-20191-1-git-send-email-guangrong.xiao@linux.intel.com> <20160912125447.GM14524@dhcp22.suse.cz> <57D6C332.4000409@intel.com> <20160912191035.GD14997@dhcp22.suse.cz> <20160913145906.GA28037@redhat.com> Cc: Xiao Guangrong , pbonzini@redhat.com, akpm@linux-foundation.org, dan.j.williams@intel.com, gleb@kernel.org, mtosatti@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, stefanha@redhat.com, yuhuang@redhat.com, linux-mm@kvack.org, ross.zwisler@linux.intel.com From: Dave Hansen Message-ID: <57D8277E.80505@intel.com> Date: Tue, 13 Sep 2016 09:21:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160913145906.GA28037@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/13/2016 07:59 AM, Oleg Nesterov wrote: > On 09/12, Michal Hocko wrote: >> > Considering how this all can be tricky and how partial reads can be >> > confusing and even misleading I am really wondering whether we >> > should simply document that only full reads will provide a sensible >> > results. > I agree. I don't even understand why this was considered as a bug. > Obviously, m_stop() which drops mmap_sep should not be called, or > all the threads should be stopped, if you want to trust the result. There was a mapping at a given address. That mapping did not change, it was not split, its attributes did not change. But, it didn't show up when reading smaps. Folks _actually_ noticed this in a test suite looking for that address range in smaps. IOW, we had goofy kernel behavior, and it broke a reasonable test program. The test program just used fgets() to read into a fixed-length buffer, which is a completely normal thing to do. To get "sensible results", doesn't userspace have to somehow know in advance how many bytes of data a given VMA will generate in smaps output? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [PATCH v2] mm, proc: Fix region lost in /proc/self/smaps Date: Tue, 13 Sep 2016 09:21:18 -0700 Message-ID: <57D8277E.80505@intel.com> References: <1473649964-20191-1-git-send-email-guangrong.xiao@linux.intel.com> <20160912125447.GM14524@dhcp22.suse.cz> <57D6C332.4000409@intel.com> <20160912191035.GD14997@dhcp22.suse.cz> <20160913145906.GA28037@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Xiao Guangrong , pbonzini@redhat.com, akpm@linux-foundation.org, dan.j.williams@intel.com, gleb@kernel.org, mtosatti@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, stefanha@redhat.com, yuhuang@redhat.com, linux-mm@kvack.org, ross.zwisler@linux.intel.com To: Oleg Nesterov , Michal Hocko Return-path: In-Reply-To: <20160913145906.GA28037@redhat.com> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.org On 09/13/2016 07:59 AM, Oleg Nesterov wrote: > On 09/12, Michal Hocko wrote: >> > Considering how this all can be tricky and how partial reads can be >> > confusing and even misleading I am really wondering whether we >> > should simply document that only full reads will provide a sensible >> > results. > I agree. I don't even understand why this was considered as a bug. > Obviously, m_stop() which drops mmap_sep should not be called, or > all the threads should be stopped, if you want to trust the result. There was a mapping at a given address. That mapping did not change, it was not split, its attributes did not change. But, it didn't show up when reading smaps. Folks _actually_ noticed this in a test suite looking for that address range in smaps. IOW, we had goofy kernel behavior, and it broke a reasonable test program. The test program just used fgets() to read into a fixed-length buffer, which is a completely normal thing to do. To get "sensible results", doesn't userspace have to somehow know in advance how many bytes of data a given VMA will generate in smaps output? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org