From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965697AbeEXJBM (ORCPT ); Thu, 24 May 2018 05:01:12 -0400 Received: from foss.arm.com ([217.140.101.70]:38608 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965332AbeEXJBI (ORCPT ); Thu, 24 May 2018 05:01:08 -0400 Subject: Re: [PATCH v2] mm/ksm: ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm To: Jia He , Andrew Morton Cc: Andrea Arcangeli , Minchan Kim , Claudio Imbrenda , Arvind Yadav , Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org, jia.he@hxt-semitech.com, Hugh Dickins References: <20180503124415.3f9d38aa@p-imbrenda.boeblingen.de.ibm.com> <1525403506-6750-1-git-send-email-hejianet@gmail.com> <20180509163101.02f23de1842a822c61fc68ff@linux-foundation.org> <2cd6b39b-1496-bbd5-9e31-5e3dcb31feda@arm.com> <6c417ab1-a808-72ea-9618-3d76ec203684@arm.com> <198fe48c-0d26-7dd1-89dc-415bd3c7ab41@gmail.com> From: Suzuki K Poulose Message-ID: <575857e6-c8ec-efa0-6434-b78a513aeaba@arm.com> Date: Thu, 24 May 2018 10:01:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <198fe48c-0d26-7dd1-89dc-415bd3c7ab41@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/05/18 09:50, Jia He wrote: > Hi Suzuki > > On 5/24/2018 4:44 PM, Suzuki K Poulose Wrote: >> On 14/05/18 10:45, Suzuki K Poulose wrote: >>> On 10/05/18 00:31, Andrew Morton wrote: >>>> On Fri,  4 May 2018 11:11:46 +0800 Jia He wrote: >>>> >>>>> In our armv8a server(QDF2400), I noticed lots of WARN_ON caused by PAGE_SIZE >>>>> unaligned for rmap_item->address under memory pressure tests(start 20 guests >>>>> and run memhog in the host). >>>>> >>>>> ... >>>>> >>>>> In rmap_walk_ksm, the rmap_item->address might still have the STABLE_FLAG, >>>>> then the start and end in handle_hva_to_gpa might not be PAGE_SIZE aligned. >>>>> Thus it will cause exceptions in handle_hva_to_gpa on arm64. >>>>> >>>>> This patch fixes it by ignoring(not removing) the low bits of address when >>>>> doing rmap_walk_ksm. >>>>> >>>>> Signed-off-by: jia.he@hxt-semitech.com >>>> >>>> I assumed you wanted this patch to be committed as >>>> From:jia.he@hxt-semitech.com rather than From:hejianet@gmail.com, so I >>>> made that change.  Please let me know if this was inappropriate. >>>> >>>> You can do this yourself by adding an explicit From: line to the very >>>> start of the patch's email text. >>>> >>>> Also, a storm of WARN_ONs is pretty poor behaviour.  Is that the only >>>> misbehaviour which this bug causes?  Do you think the fix should be >>>> backported into earlier kernels? >>>> >> >> >> Jia, Andrew, >> >> What is the status of this patch ? >> >> Suzuki > I thought the patch is merged into mmotm tree. > http://www.ozlabs.org/~akpm/mmotm/series > But I don't know what is the next step. Hi Jia, Thanks for the update. I think that should eventually hit mainline. When it does, please could you send the patch to stable kernel versions too ? Usually having a "Cc: stable@kernel.vger.org" in the original patch (for critical fixes) would have done the trick. But since we don't have it, please send it following the stable kernel rules. Cheers Suzuki From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f71.google.com (mail-oi0-f71.google.com [209.85.218.71]) by kanga.kvack.org (Postfix) with ESMTP id 12DC96B0006 for ; Thu, 24 May 2018 05:01:09 -0400 (EDT) Received: by mail-oi0-f71.google.com with SMTP id b13-v6so513852oib.11 for ; Thu, 24 May 2018 02:01:09 -0700 (PDT) Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id s3-v6si7823520otd.343.2018.05.24.02.01.07 for ; Thu, 24 May 2018 02:01:07 -0700 (PDT) Subject: Re: [PATCH v2] mm/ksm: ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm References: <20180503124415.3f9d38aa@p-imbrenda.boeblingen.de.ibm.com> <1525403506-6750-1-git-send-email-hejianet@gmail.com> <20180509163101.02f23de1842a822c61fc68ff@linux-foundation.org> <2cd6b39b-1496-bbd5-9e31-5e3dcb31feda@arm.com> <6c417ab1-a808-72ea-9618-3d76ec203684@arm.com> <198fe48c-0d26-7dd1-89dc-415bd3c7ab41@gmail.com> From: Suzuki K Poulose Message-ID: <575857e6-c8ec-efa0-6434-b78a513aeaba@arm.com> Date: Thu, 24 May 2018 10:01:03 +0100 MIME-Version: 1.0 In-Reply-To: <198fe48c-0d26-7dd1-89dc-415bd3c7ab41@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: Jia He , Andrew Morton Cc: Andrea Arcangeli , Minchan Kim , Claudio Imbrenda , Arvind Yadav , Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org, jia.he@hxt-semitech.com, Hugh Dickins On 24/05/18 09:50, Jia He wrote: > Hi Suzuki > > On 5/24/2018 4:44 PM, Suzuki K Poulose Wrote: >> On 14/05/18 10:45, Suzuki K Poulose wrote: >>> On 10/05/18 00:31, Andrew Morton wrote: >>>> On Fri,A 4 May 2018 11:11:46 +0800 Jia He wrote: >>>> >>>>> In our armv8a server(QDF2400), I noticed lots of WARN_ON caused by PAGE_SIZE >>>>> unaligned for rmap_item->address under memory pressure tests(start 20 guests >>>>> and run memhog in the host). >>>>> >>>>> ... >>>>> >>>>> In rmap_walk_ksm, the rmap_item->address might still have the STABLE_FLAG, >>>>> then the start and end in handle_hva_to_gpa might not be PAGE_SIZE aligned. >>>>> Thus it will cause exceptions in handle_hva_to_gpa on arm64. >>>>> >>>>> This patch fixes it by ignoring(not removing) the low bits of address when >>>>> doing rmap_walk_ksm. >>>>> >>>>> Signed-off-by: jia.he@hxt-semitech.com >>>> >>>> I assumed you wanted this patch to be committed as >>>> From:jia.he@hxt-semitech.com rather than From:hejianet@gmail.com, so I >>>> made that change.A Please let me know if this was inappropriate. >>>> >>>> You can do this yourself by adding an explicit From: line to the very >>>> start of the patch's email text. >>>> >>>> Also, a storm of WARN_ONs is pretty poor behaviour.A Is that the only >>>> misbehaviour which this bug causes?A Do you think the fix should be >>>> backported into earlier kernels? >>>> >> >> >> Jia, Andrew, >> >> What is the status of this patch ? >> >> Suzuki > I thought the patch is merged into mmotm tree. > http://www.ozlabs.org/~akpm/mmotm/series > But I don't know what is the next step. Hi Jia, Thanks for the update. I think that should eventually hit mainline. When it does, please could you send the patch to stable kernel versions too ? Usually having a "Cc: stable@kernel.vger.org" in the original patch (for critical fixes) would have done the trick. But since we don't have it, please send it following the stable kernel rules. Cheers Suzuki