The exterior, load-bearing walls are sitting on something below, so you can tear out the subfloor right up to that edge. If you've already torn out some of the subfloor, you should be able to look under there and verify that - might take a mirror and flashlight to get a good view, though. An interior wall may be loadbearing or not. You'd need to know which way the joists run. If the wall is running the same way as the joists, it is unlikely to be a load bearing wall, but you'd need to be careful as cutting out the subfloor without messing up that wall would want you leaving the subfloor spanning the joists around either side of that wall. Because when you replace the subfloor, you won't get it sitting and be supported on the edges, you may need to add blocking or sister a joist to have enough thickness to support the new pieces. Adding construction adhesive on the joists when installing subflooring really adds to the integrity of the subfloor. If you have a sag in a joist, you could sister a straight one next to it. This both adds strength, and give your subfloor a flat place to sit.