If I were you(knowing all 3 parks like the back of my hand) this is how I would do it.
Knott's Berry Farm for 1 day.
SFMM for 2 days.
Disneyland for 3 days.
You'll definately need 3 days for Disneyland. Two parks + Crowds = 1 day not enough.
But, I will tell you what to do for the days you have planned.
SFMM: Day 1, first thing you do is run to X. Wait for as long as you have to before they open it, as it is one of the rides that opens later than the park. It could take 10 minutes, it could take 40. Also, be sure you get to the park at 9:15, and wait at the gate until 10. I assure you will be one of the few people at the front of the gate or close to it before the park opens. This helps you get to X sooner(and you don't actually have to run). After you ride X, do what you'd like to do. Note that Viper has long lines in the morning, but later in the day, it becomes almost empty.
Scream has little to no lines at all, Colossus sometimes has a line, but it typically moves rather quickly.
Day 2: Go to Tatsu first thing. After that, continue your day however you'd like.
Day 3: Go to Deja Vu first. I once did this and went on the ride 6 times in a row the line was so short. I went back to it later in the day, and the line was 3 and a half hours. So, it's extremely wise to go to that first. After Deja Vu, go to Riddlers Revenge, then Goliath. Then, do what you'd like.
Knott's
Day 1: If you're in good health, and don't suffer from any back problems, go ride Ghostrider first. Rather rough, but an incredible ride if you don't mind getting tossed around(It's a shame too, that ride used to be amazingly smooth for a woody). Then, goto Silver Bullet. Go in the front for the best ride experience. It's smooth, calm, and fun. Then, goto the Log ride. It's an awesome log ride, and it's very old. I think the "old" factor in the ride makes it that much more fun. Next, go to Xcelerator. If you can, get the front. Note that even if the line for the front looks small, it may take an hour. The line for Xcelerator moves very fast, and the standard line may only take 20 minutes. But then again, this is summer. Anywho, every seat in this ride is a good seat. So, if you don't want to wait for the front, no worries. Then ride Supreme Scream. I LOVE this ride, and this is one of my fav's at the park. It's worth two rides if the line is short.
At this point, do what you please.
Day 2: Go to Perilous Plunge first thing. The line moves slower than a snail in slow motion. Getting the guests in one boat, and then starting it could take anywhere from 5-10 minutes. For one boat. AND, if they're running only 1 boat, lines could reach up to two hours. Since it's summer, I'd advise to go early, and dry off sooner. (Unless, you'd rather wait to near closing time, and pack in the ride at night. I assume the lines would die down at this point, but I am not too sure.) Then, goto Riptide. Try to sit near the middle, on the side facing the building, and not facing Perilous plunge. This side gets more wet, and is more exciting IMO.
After, if you're still up to get wet, head straight to Bigfoot rapids. Then if you're in for a short show, there is one right next to the enterence of Bigfoot rapids. I forget the name of it, but it's not really hard to miss(check the map).
After, I'd head towards Montezumes' Revenge, ride, then Jaguar, ride. Jaguar is a junior coaster, and is not too thrilling, but if the line is short, it's not that bad of a ride.
Disneyland: I advise you get the park hopper. The thing is, it lasts for 3 days, but you could use it for only one.
Anywho: If you're doing the park hopper, this is how I would spend the day.
Start off going into the California Adventure park. Ride Soarin' over California first! When the workers ask how many people are in your party, tell them the number, and ask for the front row. This is a must to enjoy the ride to it's full potential.
After, head towards hollywood. Ride The Hollywood Tower of Terror. Lines move fast, and at this point, it should be fairly short. After, ride the Monsters Inc ride. Then, head back towards Soarin', continue past the ride, and then enter the ride Grizzly River Run. One of the best raft rides, as it features two fun drops. Then, head towards the pier, and ride Mulholland Madness(a wild mouse ride), and then ride Maliboomer. Once those two rides are complete, ride California Screamin'. After that, leave the park, and head towards Disneyland.
Go to Space Mountain, and get the fastpass for that ride. While waiting, ride Buzz Lightyear ride. Even if most of the line is on the outside, don't worry, only about 8 minutes of the line is in the inside. If you still have time, I would go to Matterhorn. Lines may be long for this ride, so watch the time, and don't enter the line without making sure you have time. After Matterhorn, head to space mountain and ride. After, go towards Adventureland, and ride Indiana Jones, Pirates, and then Big Thunder Mountain. After that, head back towards Pirates, and ride Hounted Mansion. Then, get a fastpass for splash mountain if the line is over an hour. From this point on, you may do what you please.
Note, if you going to follow my plan, you don't have to follow it ride by ride. I know you may want to skip out on a few rides, or you may not care for some.
Hopefully I have been helpful, and tell me how your trip went! Have fun!