Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3124674yba; Mon, 8 Apr 2019 11:40:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWLHAtm+BhRmok4BYH4yzzDVYyAN3b2svB1PAMWWUfK3wuT68Oc6wxcQgXfl31BWTLy5PI X-Received: by 2002:a63:3281:: with SMTP id y123mr22938936pgy.272.1554748814582; Mon, 08 Apr 2019 11:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554748814; cv=none; d=google.com; s=arc-20160816; b=dqvWa0oq0s0+pvAiSrN0/3/zqe0WGbfVH3EURa6UOmGPtwQO0eNRQAsw7+f0E/ObP4 RE7j8DYQZxYBStgDaaUxg8F7KRgPorjlQ0Lb22pdZa8fd07XmDmeAxF2lHgP/n36Earz CGI/uijZdPWM3cOzWabXHy01p/R1GkVTZXceCJWqlhhO+NcUt6rjC+G8mxKxSa7Aukzp ZZEBtVu7dzldyd3PK1aY3OEiJqz+3i9D7GWXehC2Ix8tsxXIzAw77KOngcYWoHMskFXo YaHvxFM79LBFL6vWmudrr+TQEsuTR1A7yk8MCv/2r1SEx/bKaPkSotZugJgKVTh8f032 M0PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=6QxCx1woXIJoxK0RRPDeFB8xTfIuPiCOmQqUjahb29M=; b=eUv+J1AUm8QvnAaCUVNXOB0SskZw3DUf/nQ8elu8m1F7N1FS6NYLmN65FNaqx3k8Kp aIC37iZzQ5A3inZub28gG3PHlofzu3ETXUiddnKBYG691CcWCyy0W6zaPGwY/NR352+3 aNjGti/ZauuS6dPYnQspfpMW6O9MfrPntLREc3woQ8WymVc6Uozax9DNR747hsSQv2U6 e8lKT0GIH6TXH3bVzkVe8bx+QPokmRK2daf3+oSngwT1KORcAg61MuJjIcaTRmeqcOqQ rDfj9XAJ1pXhzLP1UuU0eyTIxGZN07pZxGPN4+ybG3ChjlND8cdBK1IzB6kewUPYlDXH l/Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BwFDwO7H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1si26947350pfh.125.2019.04.08.11.39.59; Mon, 08 Apr 2019 11:40:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BwFDwO7H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728255AbfDHR0h (ORCPT + 99 others); Mon, 8 Apr 2019 13:26:37 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43698 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726635AbfDHR0h (ORCPT ); Mon, 8 Apr 2019 13:26:37 -0400 Received: by mail-pf1-f194.google.com with SMTP id c8so8006738pfd.10 for ; Mon, 08 Apr 2019 10:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=6QxCx1woXIJoxK0RRPDeFB8xTfIuPiCOmQqUjahb29M=; b=BwFDwO7HJYO/Sbbcl6GcpnqnkQ4R9noghslVuBIR+gRjaWXL6r1GbrudJUXrRfBigr TKdQ7T7tXJ4kfqwb2xPtKx0RUcdCZ5O8GOL3mEX/8doZRh9RsZbteU+JVSTZNbdI0Hvn UHb02KHL5Ce9FFqCkC/G5noSeBD6J2gGwSKIvms09qpFjWVHolNvSOSu41FyT0m3wRL6 7R2ljrawSF/wN1T/kd+Htjyd58MnRGhVT+QC8iobCL3XWEZxx7RKmENejmWknC63Jrr2 G8xV9D8zEh4G/1MfkcnBXmEfSObjtJd6K6A1XkuH/A0YHD7JUskDNQxVx401rdpvexeN jJHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=6QxCx1woXIJoxK0RRPDeFB8xTfIuPiCOmQqUjahb29M=; b=aYBANgegh/225+B0FOzibHlHP348Ul6i4wdKNnq7M93EkxINZ24lHFbU87rvi4R9Za aK+PT+M05HTO7ba5I49X3pVDo8L4zu+ayHEQ4sGNdONAHDEisgFp4UYMuOxGEaYittnS rYTqHwNaqhMLhp5FGqqtsjRnAFLRYS1onkCumxkk6TVHuRQMEgVISwIcwV3YSs7p1Q4F 7kEuzW1gjLVFNCDwLqq3E7JXep9RSTgZswlPy2mUXJW9uWVQdKj5Zb5mYKdy20j91Om0 EXfiBnBkpPtutXQyCdOCDesVAsFE4XyOHdfy2UxGy/LEGNjapqfo8tiEOfoYf6FfzEYj gMmQ== X-Gm-Message-State: APjAAAXx9NNNwNCOJVTxsZ9Id5yZcEL3hVuM58OdreWBlQfi7ME1Q7nS b4cU3kXqtzYrICMkdLDpcdVjbw== X-Received: by 2002:a62:ac08:: with SMTP id v8mr30836524pfe.42.1554744395845; Mon, 08 Apr 2019 10:26:35 -0700 (PDT) Received: from [100.112.89.103] ([104.133.8.103]) by smtp.gmail.com with ESMTPSA id x128sm26790619pfx.103.2019.04.08.10.26.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Apr 2019 10:26:34 -0700 (PDT) Date: Mon, 8 Apr 2019 10:26:17 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Konstantin Khlebnikov cc: Hugh Dickins , "Alex Xu (Hello71)" , Vineeth Pillai , Andrew Morton , Kelley Nielsen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Rik van Riel , Huang Ying , Al Viro Subject: Re: shmem_recalc_inode: unable to handle kernel NULL pointer dereference In-Reply-To: <1b0bc97a-8162-d4df-7187-7636e5934b23@yandex-team.ru> Message-ID: References: <1553440122.7s759munpm.astroid@alex-desktop.none> <1554048843.jjmwlalntd.astroid@alex-desktop.none> <56deb587-8cd6-317a-520f-209207468c55@yandex-team.ru> <1b0bc97a-8162-d4df-7187-7636e5934b23@yandex-team.ru> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Apr 2019, Konstantin Khlebnikov wrote: > > I suppose your solution will wait for wakeup from shmem_evict_inode()? No, it's the other way round: shmem_unuse() gets on with its work without delay, shmem_evict_inode() waits until the stop_eviction count has gone down to zero, saying nobody else is at work on the inode. Waiting in shmem_evict_inode() might be more worrying, if it weren't already packed full with lock_page()s. And less attractive with the old quadratic style of swapoff, when shmem_evict_inode() would have freed the inode's swap much more efficiently than swapoff could then manage. Hugh