From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24DD4C433E0 for ; Wed, 17 Mar 2021 21:40:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C70DB64F18 for ; Wed, 17 Mar 2021 21:40:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230411AbhCQVkU (ORCPT ); Wed, 17 Mar 2021 17:40:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231233AbhCQVkN (ORCPT ); Wed, 17 Mar 2021 17:40:13 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4778C06174A for ; Wed, 17 Mar 2021 14:40:12 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id o10so1192730lfb.9 for ; Wed, 17 Mar 2021 14:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mu5e6+It/toze5nJGnhIyFS0VJ3FbuiNzP5J0FSxmiM=; b=DExLC+oYUenazcr0dKVDGwfYs4fAuUS8PyKvtqHRLy0vitmoMWLq5mtJJGCC17fHKU /gPuDO0l+PheRgNSVvs1q8yy5O0fhQIY01LMhruronV2BfshPA+OHTmgH5qK/KcbJFii ezZ1Lh6uODmI6uKX+OtgAM3Xcw9SkAtJkXevxvcjKpLBIbdbhB8NddeenstoT0gl+n/4 EP4fzxXsNgkPAO2vRQ5Q25J3NU9X/8UVIAgZpEZGzw9kN3O0LrIU9Iug3Lj11u6QLQG7 l9s0+JClecd6FUc51BsqVLYFPv3qX1b7Sdpluw2VffiXMH2rEURXILi8/tePN2IVXxjo C/Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mu5e6+It/toze5nJGnhIyFS0VJ3FbuiNzP5J0FSxmiM=; b=pRat3XajuRUrhKKVxVivjhJdfOYRH214+eD4zXgu19KiOYoQdWRCdgi5EjV5kiPEXT QLt9P5+Hva3s/6BGEwPcXwee4d2Ag90/CPIpKzVDuKnYHWzIF/3f8tmoYjx37VxzUf2+ p1fe5Wsq/Tmr5VT6Wox753UTZigTZN82+2BM9mwBaphyQ58CCXBHluG/8ufsduM8qXMM Yz12wWPZ0dv4PmZnaR1J2mV2fLxFlBR/gd7EaZWRcpdVId3fjhZKvhXL0Lsuywlcv2uU c+CNpJMoX32ZBm3FNeiDR2Tp0JbJrNS4i1cWY775wDMXJ006ji/LxBzIFsFr3XZVTouZ taPg== X-Gm-Message-State: AOAM532nR3ly0l36oSM7P25GwmsLozPnqC4Ebynb5kK12KWZ0jthMnYP 9JiWNDEgCiigeQi3ZkaV12fSWKgYkwYEbQ2hWqFmBQ== X-Google-Smtp-Source: ABdhPJxzzg2E6OLr9amBx/f+18p6p59ql3Wg/KVdN4jUu8TXJXogvqiL3IU0qvTFyjQDkMrvZVVGBjdIDrn/efRjrwI= X-Received: by 2002:a19:c14a:: with SMTP id r71mr3357493lff.358.1616017211101; Wed, 17 Mar 2021 14:40:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shakeel Butt Date: Wed, 17 Mar 2021 14:39:58 -0700 Message-ID: Subject: Re: [BUG -next] "memcg: charge before adding to swapcache on swapin" broken To: Heiko Carstens Cc: Andrew Morton , Roman Gushchin , Johannes Weiner , Hugh Dickins , Juergen Christ , Christian Borntraeger , Vasily Gorbik , Linux MM , Linux-Next Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Wed, Mar 17, 2021 at 2:11 PM Heiko Carstens wrote: > > On Wed, Mar 17, 2021 at 09:44:21PM +0100, Heiko Carstens wrote: > > On Wed, Mar 17, 2021 at 08:44:14AM -0700, Shakeel Butt wrote: > > > > Config below. And the fun thing is that I cannot reproduce it today > > > > anymore with the elfutils test case - what _seems_ to be different is > > > > that the test suite runs much faster than yesterday evening. Usually > > > > an indication that there is no steal time (other guests which steal > > > > cpu time), which again _could_ indicate a race / lack of locking > > > > somewhere. > > > > This is kind of odd, since yesterday evening it was very reliable to > > > > trigger the bug :/ > > > > > > > > > > Thanks for the config. One question regarding swap, is it disk based > > > swap or zram? > > > > Swap device is a real disk. > > > > > By guests, do you mean there was another significant workload running > > > on the machine in parallel to the tests? > > > > That I don't know. I didn't check. I still can't reproduce with > > elfutils anymore, however... > > > > > If you don't mind can you try swapping01 as well. > > > > ltp's swapping01 test triggers immediately random processes being > > killed with SIGSEGV. I also tested with linux-next 20210316 and _only_ > > "memcg: charge before adding to swapcache on swapin" being reverted on > > top, and the problem is away - so it looks like the result of > > yesterday's bisect is indeed valid. > > I have to correct myself, actually the system has both: a real disk > _and_ zram as swap devices: > > # swapon -s > Filename Type Size Used Priority > /dev/dasdb1 partition 21635084 0 -2 > /dev/zram0 partition 1014780 0 100 > > When I disable /dev/zram with "swapoff /dev/zram0" the problem is away > as well, even with your patch applied. Thanks a lot. This was really helpful. I will try with zram on my setup. Can you also try with just one type of swap at the time for both? I really appreciate your help. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A386C433DB for ; Wed, 17 Mar 2021 21:40:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D596764F18 for ; Wed, 17 Mar 2021 21:40:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D596764F18 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 21C116B0070; Wed, 17 Mar 2021 17:40:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CD446B0071; Wed, 17 Mar 2021 17:40:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 047746B0072; Wed, 17 Mar 2021 17:40:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0112.hostedemail.com [216.40.44.112]) by kanga.kvack.org (Postfix) with ESMTP id DBD656B0070 for ; Wed, 17 Mar 2021 17:40:13 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 899AC1F1A for ; Wed, 17 Mar 2021 21:40:13 +0000 (UTC) X-FDA: 77930684706.10.64877D6 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by imf16.hostedemail.com (Postfix) with ESMTP id D59CC8019162 for ; Wed, 17 Mar 2021 21:40:12 +0000 (UTC) Received: by mail-lf1-f51.google.com with SMTP id u10so1194008lff.1 for ; Wed, 17 Mar 2021 14:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mu5e6+It/toze5nJGnhIyFS0VJ3FbuiNzP5J0FSxmiM=; b=DExLC+oYUenazcr0dKVDGwfYs4fAuUS8PyKvtqHRLy0vitmoMWLq5mtJJGCC17fHKU /gPuDO0l+PheRgNSVvs1q8yy5O0fhQIY01LMhruronV2BfshPA+OHTmgH5qK/KcbJFii ezZ1Lh6uODmI6uKX+OtgAM3Xcw9SkAtJkXevxvcjKpLBIbdbhB8NddeenstoT0gl+n/4 EP4fzxXsNgkPAO2vRQ5Q25J3NU9X/8UVIAgZpEZGzw9kN3O0LrIU9Iug3Lj11u6QLQG7 l9s0+JClecd6FUc51BsqVLYFPv3qX1b7Sdpluw2VffiXMH2rEURXILi8/tePN2IVXxjo C/Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mu5e6+It/toze5nJGnhIyFS0VJ3FbuiNzP5J0FSxmiM=; b=gYDKImYdZ8jF5cnThC7j6gQtIKQtixjWvNALJXRO8J4ON8p2BY1Fk0WF2B5e+Q/QXk fLu0960Id74yoaxwiKNW0EVT7Iu2Dk80fir09J1dUcyeFTSl08wTjAmLhWzIFaA/N7+u VFnT+TQpDfSA6PkaUtnnuBrr9kkXDPpg8iA7mpOS0MfxeQpIcKvGu2LP52gpAFwcqk3H tD6UsFrTiUePMQJib+6zBCMRCn09+d57e6eVSrdeYUoiEy847jiNFg1hz4CATR3t1lGz 4sdFlf1O0ubRtR826AX+h0cmFklFSaCh25qkpgM9Q0epuFVye9OECDTFos4kjuiv6d7U 0ZWA== X-Gm-Message-State: AOAM532W24dvDbIq/kOqLEGYtHC/ML1x7/Fzxk8jZ0WmIsi6IhE6xHPl IzNnJiFEjlbWjSsQL5q9GIZtq1ol5AHLcalEwPt+xQ== X-Google-Smtp-Source: ABdhPJxzzg2E6OLr9amBx/f+18p6p59ql3Wg/KVdN4jUu8TXJXogvqiL3IU0qvTFyjQDkMrvZVVGBjdIDrn/efRjrwI= X-Received: by 2002:a19:c14a:: with SMTP id r71mr3357493lff.358.1616017211101; Wed, 17 Mar 2021 14:40:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shakeel Butt Date: Wed, 17 Mar 2021 14:39:58 -0700 Message-ID: Subject: Re: [BUG -next] "memcg: charge before adding to swapcache on swapin" broken To: Heiko Carstens Cc: Andrew Morton , Roman Gushchin , Johannes Weiner , Hugh Dickins , Juergen Christ , Christian Borntraeger , Vasily Gorbik , Linux MM , Linux-Next Mailing List Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D59CC8019162 X-Stat-Signature: 6ag6i1oieyphhncprwo857eoop71oey9 Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=mail-lf1-f51.google.com; client-ip=209.85.167.51 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616017212-518635 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Mar 17, 2021 at 2:11 PM Heiko Carstens wrote: > > On Wed, Mar 17, 2021 at 09:44:21PM +0100, Heiko Carstens wrote: > > On Wed, Mar 17, 2021 at 08:44:14AM -0700, Shakeel Butt wrote: > > > > Config below. And the fun thing is that I cannot reproduce it today > > > > anymore with the elfutils test case - what _seems_ to be different is > > > > that the test suite runs much faster than yesterday evening. Usually > > > > an indication that there is no steal time (other guests which steal > > > > cpu time), which again _could_ indicate a race / lack of locking > > > > somewhere. > > > > This is kind of odd, since yesterday evening it was very reliable to > > > > trigger the bug :/ > > > > > > > > > > Thanks for the config. One question regarding swap, is it disk based > > > swap or zram? > > > > Swap device is a real disk. > > > > > By guests, do you mean there was another significant workload running > > > on the machine in parallel to the tests? > > > > That I don't know. I didn't check. I still can't reproduce with > > elfutils anymore, however... > > > > > If you don't mind can you try swapping01 as well. > > > > ltp's swapping01 test triggers immediately random processes being > > killed with SIGSEGV. I also tested with linux-next 20210316 and _only_ > > "memcg: charge before adding to swapcache on swapin" being reverted on > > top, and the problem is away - so it looks like the result of > > yesterday's bisect is indeed valid. > > I have to correct myself, actually the system has both: a real disk > _and_ zram as swap devices: > > # swapon -s > Filename Type Size Used Priority > /dev/dasdb1 partition 21635084 0 -2 > /dev/zram0 partition 1014780 0 100 > > When I disable /dev/zram with "swapoff /dev/zram0" the problem is away > as well, even with your patch applied. Thanks a lot. This was really helpful. I will try with zram on my setup. Can you also try with just one type of swap at the time for both? I really appreciate your help.