Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5762740imm; Mon, 23 Jul 2018 05:46:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd8FcWMvxEtbqly18a7z6vyEdVMMuQp/vRZdXl3QfqoIdhPZCYvfNPoDgvh6sUsxSgCPn0P X-Received: by 2002:a63:4e5f:: with SMTP id o31-v6mr12295324pgl.256.1532349983629; Mon, 23 Jul 2018 05:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532349983; cv=none; d=google.com; s=arc-20160816; b=i88Wenr0EQwA/jArZjGyTeMIeth0dmBV8Zh226gk0QPj/LSnNreNee2I+3QXIyBWBr mxhonuLXMnmd8eBGHmo0xXb1LPDKqC6VQCUurByZyCWLvbucg/9s2FgFRAmR290vLmhS QG6+6JjKfsN4hiBONyD6kwgQ256wbFvpOYTmlugFEkmkyGBAFiITcS48EjB5VsjvS3D3 g3X0/JsGffD44QFZ9XBH6UrHi2mXTZyL1AKR98xVf/0HyAhIkz+nSpx01jIhOTqth7wZ BtVG7oEUw59shu5D7LHED8AEuAgHmIMmjLCeMw2q3iZ02PossfWa1zQhasF6xkmNT75p iumw== 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 :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Qt3WrtwDSexLVDBvpueEnc4dLSFbJahLgujzBNpna2U=; b=t6KjxvBiJVQYSuPvy8G13u0uswlODdoolN2P/3dfxXR4arXvXKI39K43kk2NGfR0pi sa7+fnOac9Ehvuw3HFjYb1tSo+VVIAwz0MIhR22ZuBGP49vlGhW1bwaawkjnVPO79qaF 1llaPM+ftztsqOiz92zvMXD70cz5imbGa8IPc5/2bT9XXUg/ZWPo8hMZsN9RjOzrEqb/ +OqRAUDCAROVxjX1EidZIFE9r0aVdgLXkkw6PH/lwMbcQ2GRaN5B5HlmCoJrhHgSAnvP 2wKvR6Fm3RuDolk0Sd1BxOilPsebmkStUIapUadI+qJI6hGUTyjMRqY2VdsjXlqHB468 kyFQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si6935878ply.251.2018.07.23.05.46.09; Mon, 23 Jul 2018 05:46:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388511AbeGWNpZ (ORCPT + 99 others); Mon, 23 Jul 2018 09:45:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48280 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388546AbeGWNob (ORCPT ); Mon, 23 Jul 2018 09:44:31 -0400 Received: from localhost (LFbn-1-12238-233.w90-92.abo.wanadoo.fr [90.92.53.233]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C3E60C7D; Mon, 23 Jul 2018 12:43:27 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Brodkin , Vineet Gupta Subject: [PATCH 4.4 005/107] ARC: Fix CONFIG_SWAP Date: Mon, 23 Jul 2018 14:40:59 +0200 Message-Id: <20180723122413.201588043@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180723122413.003644357@linuxfoundation.org> References: <20180723122413.003644357@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexey Brodkin commit 6e3761145a9ba3ce267c330b6bff51cf6a057b06 upstream. swap was broken on ARC due to silly copy-paste issue. We encode offset from swapcache page in __swp_entry() as (off << 13) but were not decoding back in __swp_offset() as (off >> 13) - it was still (off << 13). This finally fixes swap usage on ARC. | # mkswap /dev/sda2 | | # swapon -a -e /dev/sda2 | Adding 500728k swap on /dev/sda2. Priority:-2 extents:1 across:500728k | | # free | total used free shared buffers cached | Mem: 765104 13456 751648 4736 8 4736 | -/+ buffers/cache: 8712 756392 | Swap: 500728 0 500728 Cc: stable@vger.kernel.org Signed-off-by: Alexey Brodkin Signed-off-by: Vineet Gupta Signed-off-by: Greg Kroah-Hartman --- arch/arc/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arc/include/asm/pgtable.h +++ b/arch/arc/include/asm/pgtable.h @@ -372,7 +372,7 @@ void update_mmu_cache(struct vm_area_str /* Decode a PTE containing swap "identifier "into constituents */ #define __swp_type(pte_lookalike) (((pte_lookalike).val) & 0x1f) -#define __swp_offset(pte_lookalike) ((pte_lookalike).val << 13) +#define __swp_offset(pte_lookalike) ((pte_lookalike).val >> 13) /* NOPs, to keep generic kernel happy */ #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })